diff --git a/wx/py/introspect.py b/wx/py/introspect.py index 11d36ce5..b7c119cf 100644 --- a/wx/py/introspect.py +++ b/wx/py/introspect.py @@ -39,8 +39,11 @@ def getAttributeNames(obj, includeMagic=1, includeSingle=1, if not hasattrAlwaysReturnsTrue(obj): # Add some attributes that don't always get picked up. special_attrs = ['__bases__', '__class__', '__dict__', '__name__', - 'func_closure', 'func_code', 'func_defaults', - 'func_dict', 'func_doc', 'func_globals', 'func_name'] + '__closure__', '__code__', '__defaults__', + '__globals__', + '__builtins__', # Added to method attributes in 3.10 + '__get__', # Not found in `dir(method)` in 3.11 + ] attributes += [attr for attr in special_attrs \ if hasattr(obj, attr)] if includeMagic: diff --git a/wx/py/tests/test_introspect.py b/wx/py/tests/test_introspect.py index a33ef3e9..9aedfb79 100644 --- a/wx/py/tests/test_introspect.py +++ b/wx/py/tests/test_introspect.py @@ -411,9 +411,12 @@ class GetAttributeTestCase(unittest.TestCase): '__builtins__', '__call__', '__class__', + '__closure__', '__cmp__', + '__code__', '__coerce__', '__contains__', + '__defaults__', '__del__', '__delattr__', '__delitem__', @@ -428,12 +431,14 @@ class GetAttributeTestCase(unittest.TestCase): '__flags__', '__float__', '__floordiv__', + '__func__', '__ge__', '__get__', '__getattr__', '__getattribute__', '__getitem__', '__getslice__', + '__globals__', '__gt__', '__hash__', '__hex__', @@ -522,18 +527,18 @@ class GetAttributeTestCase(unittest.TestCase): 'fileno', 'find', 'flush', - 'func_closure', - 'func_code', - 'func_defaults', - 'func_dict', - 'func_doc', - 'func_globals', - 'func_name', + # 'func_closure', + # 'func_code', + # 'func_defaults', + # 'func_dict', + # 'func_doc', + # 'func_globals', + # 'func_name', 'get', 'has_key', - 'im_class', - 'im_func', - 'im_self', + # 'im_class', + # 'im_func', + # 'im_self', 'imag', 'index', 'insert',