From 1c8554cee2802b8b79db14e1772d7a0f5a4c4e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A5l=20Gr=C3=B8n=C3=A5s=20Drange?= Date: Thu, 5 Nov 2020 14:15:19 +0100 Subject: [PATCH] Drop import of deprecated method The method inspect.getfullargspec was introduced in Python 3 as an improvement over inspect.getargspec, however both were imported while we still supported Python 2. Now that we have dropped Python 2 support, we can assume that the method inspect.getfullargspec exists. --- configsuite/extension/ext.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/configsuite/extension/ext.py b/configsuite/extension/ext.py index 63bc95c0..f6a94ca0 100644 --- a/configsuite/extension/ext.py +++ b/configsuite/extension/ext.py @@ -18,13 +18,7 @@ import os import importlib - -# The getargspec/getfullargspec should be dropped -# for the "signature" module when python2 is not supported -try: - from inspect import getfullargspec as inspect_method -except ImportError: - from inspect import getargspec as inspect_method +import inspect from docutils.parsers.rst import Directive from docutils.parsers.rst.directives import unchanged_required @@ -187,7 +181,7 @@ def run(self): ) raise self.error(err_msg.format(func_name=func_str)) - insp = inspect_method(schema_func) # pylint: disable=deprecated-method + insp = inspect.getfullargspec(schema_func) if len(insp.args) != 0: err_msg = ( "The module.function given at Configsuite :module: "