Fixed callable_name
@@ -489,11 +489,11 @@ def callable_name(callable_obj):
meth = callable_obj
if sys.version_info < (3,0):
owner = meth.im_class if meth.im_self is None else meth.im_self
- else:
- return meth.__func__.__qualname__.replace('__call__', '')
if meth.__name__ == '__call__':
return type(owner).__name__
return '.'.join([owner.__name__, meth.__name__])
+ else:
+ return meth.__func__.__qualname__.replace('.__call__', '')
elif isinstance(callable_obj, types.GeneratorType):
return callable_obj.__name__
else:
