Skip to content

Commit

Permalink
Merge pull request #94 from stephenfin/stop-using-argspec
Browse files Browse the repository at this point in the history
Fix #81: Stop using 'inspect.getargspec()'
  • Loading branch information
RonnyPfannschmidt committed Nov 24, 2017
2 parents b579e7a + 451515a commit 817170d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 9 additions & 1 deletion pluggy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def varnames(func):
return ()

try: # func MUST be a function or method here or we won't parse any args
spec = inspect.getargspec(func)
spec = _getargspec(func)
except TypeError:
return (), ()

Expand Down Expand Up @@ -662,6 +662,14 @@ def __init__(self, plugin, plugin_name, function, hook_impl_opts):
self.__dict__.update(hook_impl_opts)


if hasattr(inspect, 'getfullargspec'):
def _getargspec(func):
return inspect.getfullargspec(func)
else:
def _getargspec(func):
return inspect.getargspec(func)


if hasattr(inspect, 'signature'):
def _formatdef(func):
return "%s%s" % (
Expand Down
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ addopts=-rxsX
norecursedirs=.tox ja .hg .env*
filterwarnings =
error
# inspect.getargspec() ignored, should be fixed in #81
ignore:inspect.getargspec().*deprecated

[flake8]
max-line-length=99

0 comments on commit 817170d

Please sign in to comment.