Skip to content

Commit 93c7530

Browse files
riconnonkvesteri
authored andcommitted
Use inspect.getfullargspec() in Python3 (#110)
Select argspec based on python version
1 parent 676b65c commit 93c7530

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

validators/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,15 @@ def func_args_as_dict(func, args, kwargs):
3737
Return given function's positional and key value arguments as an ordered
3838
dictionary.
3939
"""
40+
if six.PY2:
41+
_getargspec = inspect.getargspec
42+
else:
43+
_getargspec = inspect.getfullargspec
44+
4045
arg_names = list(
4146
OrderedDict.fromkeys(
4247
itertools.chain(
43-
inspect.getargspec(func)[0],
48+
_getargspec(func)[0],
4449
kwargs.keys()
4550
)
4651
)

0 commit comments

Comments
 (0)