You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2021-12-16.15:40:43.879>labels= ['type-bug', 'library', '3.11']
title='inspect.getmembers will call the instance __bases__ attribute, which may cause an exception'updated_at=<Date2022-01-23.17:40:42.489>user='https://github.com/hongweipeng'
root@debian:/workspace/cpython# ./python
Python 3.11.0a3+ (heads/main-dirty:b123ad8030, Dec 16 2021, 06:16:15) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import inspect
>>> classFoo:
... def__getattr__(self, attr):
... returnNone
...
>>> inspect.getmembers(Foo())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/workspace/cpython/Lib/inspect.py", line 488, in getmembers
return _getmembers(object, predicate, getattr)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/cpython/Lib/inspect.py", line 455, in _getmembers
for base in object.__bases__:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: