Skip to content

Commit 56a1b39

Browse files
committed
Merge pull request #18 from takluyver/getfullargspec
BUG: Use getfullargspec() on Python 3
2 parents e433d27 + 6d609b7 commit 56a1b39

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

numpydoc/docscrape.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import pydoc
1010
from warnings import warn
1111
import collections
12+
import sys
1213

1314

1415
class Reader(object):
@@ -433,7 +434,10 @@ def __init__(self, func, role='func', doc=None, config={}):
433434
func, func_name = self.get_func()
434435
try:
435436
# try to read signature
436-
argspec = inspect.getargspec(func)
437+
if sys.version_info[0] >= 3:
438+
argspec = inspect.getfullargspec(func)
439+
else:
440+
argspec = inspect.getargspec(func)
437441
argspec = inspect.formatargspec(*argspec)
438442
argspec = argspec.replace('*','\*')
439443
signature = '%s%s' % (func_name, argspec)

0 commit comments

Comments
 (0)