From 8b8bd630f2b19bc70537a007c531133cd3cd8c7a Mon Sep 17 00:00:00 2001 From: Tianzhu Qiao Date: Sat, 21 Apr 2018 08:51:28 -0700 Subject: [PATCH] Fix a python3 compatibility issue to get class instance and function objects --- wx/py/introspect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wx/py/introspect.py b/wx/py/introspect.py index 434e667b..507400d4 100644 --- a/wx/py/introspect.py +++ b/wx/py/introspect.py @@ -350,14 +350,14 @@ def getBaseObject(obj): # inspect.getargspec() complains that the object isn't a # Python function. try: - if obj.im_self is None: + if obj.__self__ is None: # This is an unbound method so we do not drop self # from the argspec, since an instance must be passed # as the first arg. dropSelf = 0 else: dropSelf = 1 - obj = obj.im_func + obj = obj.__func__ except AttributeError: dropSelf = 0 elif inspect.isclass(obj):