Merge pull request #867 from RobinD42/fix-issue855

im_func --> __func__
(cherry picked from commit 6b858b5966)
This commit is contained in:
Robin Dunn
2018-05-30 21:02:57 -07:00
parent 57fb12c877
commit 0c75ee6277

View File

@@ -371,7 +371,7 @@ def getBaseObject(obj):
elif callable(obj):
# Get the __call__ method instead.
try:
obj = obj.__call__.im_func
obj = obj.__call__.__func__
dropSelf = 1
except AttributeError:
dropSelf = 0
@@ -382,7 +382,7 @@ def getBaseObject(obj):
def getConstructor(obj):
"""Return constructor for class object, or None if there isn't one."""
try:
return obj.__init__.im_func
return obj.__init__.__func__
except AttributeError:
for base in obj.__bases__:
constructor = getConstructor(base)