Skip to content

Commit

Permalink
2/3 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
vreuter committed May 2, 2019
1 parent b0cc865 commit 9f53ed0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_collection.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
""" Tests for collection utilities """

from collections import OrderedDict
import inspect
import sys
if sys.version_info.major < 3:
from inspect import getargspec as get_fun_sig
else:
from inspect import getfullargspec as get_fun_sig
import random
import string
import sys
Expand All @@ -23,7 +27,7 @@ def get_default_parameters(func, pred=None):
"""
if not callable(func):
raise TypeError("Not a callable: {} ({})".format(func.__name__, type(func)))
spec = inspect.getfullargspec(func)
spec = get_fun_sig(func)
par_arg_pairs = zip(spec.args[(len(spec.args) - len(spec.defaults)):],
spec.defaults)
return OrderedDict(
Expand Down

0 comments on commit 9f53ed0

Please sign in to comment.