Skip to content
Snippets Groups Projects
Commit ae23043d authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Use inspect.signature instead of the deprecated getargspec

See merge request !1485
parents b3caecf0 ef0a7a9a
No related branches found
No related tags found
1 merge request!1485Use inspect.signature instead of the deprecated getargspec
Pipeline #6185872 passed
......@@ -75,9 +75,19 @@ class QMTTest(BaseTest):
self.callable = callable
self.extra_args = extra_args
# get the list of names of positional arguments
from inspect import getargspec
try:
# Removed in Python 3.11
from inspect import getargspec
self.args_order = getargspec(callable)[0]
self.args_order = getargspec(callable)[0]
except ImportError:
import inspect
self.args_order = [
param.name
for param in inspect.signature(callable).parameters.values()
if param.kind == inspect.Parameter.POSITIONAL_OR_KEYWORD
]
# Remove "self" from the list of positional arguments
# since it is added automatically
if self.args_order[0] == "self":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment