Merge "Python 3: replace "im_self" by "__self__""
This commit is contained in:
commit
6b15c40ba9
@ -32,9 +32,9 @@ def make_pretty_name(method):
|
||||
"""Makes a pretty name for a function/method."""
|
||||
meth_pieces = [method.__name__]
|
||||
# If its an instance method attempt to tack on the class name
|
||||
if hasattr(method, 'im_self') and method.im_self is not None:
|
||||
if hasattr(method, '__self__') and method.__self__ is not None:
|
||||
try:
|
||||
meth_pieces.insert(0, method.im_self.__class__.__name__)
|
||||
meth_pieces.insert(0, method.__self__.__class__.__name__)
|
||||
except AttributeError:
|
||||
pass
|
||||
return ".".join(meth_pieces)
|
||||
|
Loading…
x
Reference in New Issue
Block a user