Fix inspect module deprecation warning

DeprecationWarning: inspect.getargspec() is deprecated since
Python 3.0, use inspect.signature() or inspect.getfullargspec()

Change-Id: I3707546e77acb9dec56ec33cbabb3e6228525f9c
This commit is contained in:
michaeltchapman 2020-07-08 13:58:32 +10:00 committed by Erik Olof Gunnar Andersson
parent 0356f6eaf1
commit d46eb24980
2 changed files with 3 additions and 3 deletions

View File

@ -812,8 +812,8 @@ class TestCase(base.BaseTestCase):
def _ensure_interface(self, interface, implementation):
for name in interface.__abstractmethods__:
in_arginfo = inspect.getargspec(getattr(interface, name))
im_arginfo = inspect.getargspec(getattr(implementation, name))
in_arginfo = inspect.getfullargspec(getattr(interface, name))
im_arginfo = inspect.getfullargspec(getattr(implementation, name))
self.assertEqual(
in_arginfo, im_arginfo,

View File

@ -190,7 +190,7 @@ def validate_uuid(*check):
"""
def inner(f):
def wrapper(*args, **kwargs):
arg_spec = inspect.getargspec(f).args
arg_spec = inspect.getfullargspec(f).args
# Ensure that we have the exact number of parameters that the
# function expects. This handles URLs like