Fix python35 job failures

- inspect.getargspec()` was deprecated in Python 3.0 and will be removed
  in 3.6 (ETA late 2016). From Python 3.5 it started throwing a deprecation
  warning which leds some tests failures.

Change-Id: Ic57fd8629031a1a7a3e72b36bff133faf67544db
This commit is contained in:
pawnesh.kumar
2016-10-27 10:39:25 +05:30
parent bf3f50a735
commit 82f22821c7

View File

@@ -50,10 +50,10 @@ def validate_args(fn, *args, **kwargs):
:param arg: the positional arguments supplied :param arg: the positional arguments supplied
:param kwargs: the keyword arguments supplied :param kwargs: the keyword arguments supplied
""" """
argspec = inspect.getargspec(fn) argspec = list(inspect.signature(fn).parameters.keys())
num_defaults = len(argspec.defaults or []) num_defaults = len(argspec or [])
required_args = argspec.args[:len(argspec.args) - num_defaults] required_args = argspec[:len(argspec) - num_defaults]
def isbound(method): def isbound(method):
return getattr(method, '__self__', None) is not None return getattr(method, '__self__', None) is not None