mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-07-21 12:41:10 +02:00
Change special_attrs from PY2 to PY3
Change deprecated variables in PY2 to new ones in PY3
This commit is contained in:
@@ -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:
|
||||
|
@@ -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',
|
||||
|
Reference in New Issue
Block a user