Skip to content

Commit 817170d

Browse files
Merge pull request #94 from stephenfin/stop-using-argspec
Fix #81: Stop using 'inspect.getargspec()'
2 parents b579e7a + 451515a commit 817170d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

pluggy/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ def varnames(func):
492492
return ()
493493

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

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

664664

665+
if hasattr(inspect, 'getfullargspec'):
666+
def _getargspec(func):
667+
return inspect.getfullargspec(func)
668+
else:
669+
def _getargspec(func):
670+
return inspect.getargspec(func)
671+
672+
665673
if hasattr(inspect, 'signature'):
666674
def _formatdef(func):
667675
return "%s%s" % (

tox.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ addopts=-rxsX
3939
norecursedirs=.tox ja .hg .env*
4040
filterwarnings =
4141
error
42-
# inspect.getargspec() ignored, should be fixed in #81
43-
ignore:inspect.getargspec().*deprecated
4442

4543
[flake8]
4644
max-line-length=99

0 commit comments

Comments
 (0)