MAINT: make docstring rewriting robust to nonexistent docstrings
@@ -304,6 +304,7 @@ def use_signature(Obj):
f._uses_signature = Obj
# Supplement the docstring of f with information from Obj
+ if Obj.__doc__:
doclines = Obj.__doc__.splitlines()
if f.__doc__:
doc = f.__doc__ + '\n'.join(doclines[1:])
@@ -314,6 +315,7 @@ def use_signature(Obj):
except AttributeError:
# __doc__ is not modifiable for classes in Python < 3.3
pass
+
return f
return decorate
