Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dbdbbc8

Browse files
committed
If functor's __name__ is not available then just stringify it
1 parent 9677675 commit dbdbbc8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

zerorpc/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class DecoratorBase(object):
3333
def __init__(self, functor):
3434
self._functor = functor
3535
self.__doc__ = functor.__doc__
36-
self.__name__ = functor.__name__
36+
self.__name__ = getattr(functor, "__name__", str(functor))
3737

3838
def __get__(self, instance, type_instance=None):
3939
if instance is None:

0 commit comments

Comments
 (0)