Skip to content

Commit 94d8d93

Browse files
numpydoc.docscrape: Restore support for Python 3.4.
Fixing backwards compatibility bug introduced in commit 254494c, which broke support for Python 3.4 when passing the builtin method 'mro' of 'type' objects to 'inspect.signature', raising a 'ValueError'.
1 parent 452dae7 commit 94d8d93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

numpydoc/docscrape.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,9 @@ def __init__(self, func, role='func', doc=None, config={}):
473473
if not self['Signature'] and func is not None:
474474
func, func_name = self.get_func()
475475
try:
476-
if hasattr(inspect, 'signature'):
476+
try:
477477
signature = str(inspect.signature(func))
478-
else:
478+
except (AttributeError, ValueError):
479479
# try to read signature, backward compat for older Python
480480
if sys.version_info[0] >= 3:
481481
argspec = inspect.getfullargspec(func)

0 commit comments

Comments
 (0)