From 82f22821c7fd0502c3272d46333ce8f2e2faf157 Mon Sep 17 00:00:00 2001 From: "pawnesh.kumar" Date: Thu, 27 Oct 2016 10:39:25 +0530 Subject: [PATCH] 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 --- mistralclient/openstack/common/cliutils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mistralclient/openstack/common/cliutils.py b/mistralclient/openstack/common/cliutils.py index 4018b1e..42b373a 100644 --- a/mistralclient/openstack/common/cliutils.py +++ b/mistralclient/openstack/common/cliutils.py @@ -50,10 +50,10 @@ def validate_args(fn, *args, **kwargs): :param arg: the positional 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 []) - required_args = argspec.args[:len(argspec.args) - num_defaults] + num_defaults = len(argspec or []) + required_args = argspec[:len(argspec) - num_defaults] def isbound(method): return getattr(method, '__self__', None) is not None