Skip to content

Commit 213982d

Browse files
committed
Use getfullargspec in Python 3.
1 parent b00229a commit 213982d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tests/test_global_arguments.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
from glob import glob
22
from importlib import import_module
3-
from inspect import getargspec, getmembers
3+
from inspect import getmembers
44
from os import path
55
from types import FunctionType
66
from unittest import TestCase
77

8+
try:
9+
from inspect import getfullargspec
10+
except ImportError:
11+
from inspect import getargspec as getfullargspec
12+
813
from pyinfra import operations
914
from pyinfra.api.operation_kwargs import OPERATION_KWARGS
1015

@@ -39,7 +44,7 @@ def test_operations_do_not_use_global_arguments(self):
3944
global_arg_keys.update(kwargs.keys())
4045

4146
for op_module, op_func in iter_operations():
42-
argspec = getargspec(op_func._pyinfra_op)
47+
argspec = getfullargspec(op_func._pyinfra_op)
4348
for arg in argspec.args:
4449
assert arg not in global_arg_keys, \
4550
'`{0}` argument found in {1}.{2} operation function'.format(

words.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ fullmatch
112112
gaierror
113113
generic
114114
getargspec
115+
getfullargspec
115116
getcallargs
116117
getfo
117118
getframeinfo

0 commit comments

Comments
 (0)