File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
from glob import glob
2
2
from importlib import import_module
3
- from inspect import getargspec , getmembers
3
+ from inspect import getmembers
4
4
from os import path
5
5
from types import FunctionType
6
6
from unittest import TestCase
7
7
8
+ try :
9
+ from inspect import getfullargspec
10
+ except ImportError :
11
+ from inspect import getargspec as getfullargspec
12
+
8
13
from pyinfra import operations
9
14
from pyinfra .api .operation_kwargs import OPERATION_KWARGS
10
15
@@ -39,7 +44,7 @@ def test_operations_do_not_use_global_arguments(self):
39
44
global_arg_keys .update (kwargs .keys ())
40
45
41
46
for op_module , op_func in iter_operations ():
42
- argspec = getargspec (op_func ._pyinfra_op )
47
+ argspec = getfullargspec (op_func ._pyinfra_op )
43
48
for arg in argspec .args :
44
49
assert arg not in global_arg_keys , \
45
50
'`{0}` argument found in {1}.{2} operation function' .format (
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ fullmatch
112
112
gaierror
113
113
generic
114
114
getargspec
115
+ getfullargspec
115
116
getcallargs
116
117
getfo
117
118
getframeinfo
You can’t perform that action at this time.
0 commit comments