summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlikui <likui@yovole.com>2021-05-10 17:40:26 +0800
committerwu.chunyang <wchy1001@gmail.com>2023-04-18 09:46:58 +0000
commit18a83dbaf1e72b4b7ea3b4598328e947d5a372b2 (patch)
tree2b1e3ddfc546852c5179123e1cec0f8b774dcc30
parent71d7b183193b8aa94b1eae4831a108b8c3534c30 (diff)
downloadtrove-18a83dbaf1e72b4b7ea3b4598328e947d5a372b2.tar.gz
Fix inspect.getargspec() deprecation warning
DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() or inspect.getfullargspec() [1] https://docs.python.org/3/library/inspect.html#inspect.getargspec Story: 2010694 Task: 47804 Change-Id: Ica14e66d2130dbc5949a6567673e68e8bb450061
-rw-r--r--trove/cmd/manage.py2
-rw-r--r--trove/common/utils.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/trove/cmd/manage.py b/trove/cmd/manage.py
index c6e3c675..424919e7 100644
--- a/trove/cmd/manage.py
+++ b/trove/cmd/manage.py
@@ -46,7 +46,7 @@ class Commands(object):
def execute(self):
exec_method = getattr(self, CONF.action.name)
- args = inspect.getargspec(exec_method)
+ args = inspect.getfullargspec(exec_method)
args.args.remove('self')
kwargs = {}
for arg in args.args:
diff --git a/trove/common/utils.py b/trove/common/utils.py
index 49823db5..fece3c4a 100644
--- a/trove/common/utils.py
+++ b/trove/common/utils.py
@@ -174,7 +174,7 @@ class MethodInspector(object):
@cached_property
def argspec(self):
- return inspect.getargspec(self._func)
+ return inspect.getfullargspec(self._func)
def __str__(self):
optionals = ["[{0}=<{0}>]".format(k) for k, v in self.optional_args]