Debugger: Port away from deprecated getargspec

https://docs.python.org/3/whatsnew/3.11.html suggests using
getfullargspec instead.

Fixes: QTCREATORBUG-28505
Change-Id: I27199f7e2c3a070c675dce3a152d201e22a16380
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Łukasz Wojniłowicz
2023-01-07 20:02:38 +01:00
parent 0648cd49f9
commit 76260f8038

View File

@@ -2495,7 +2495,10 @@ class DumperBase():
try: try:
if funcname.startswith('qdump__'): if funcname.startswith('qdump__'):
typename = funcname[7:] typename = funcname[7:]
spec = inspect.getargspec(function) if sys.version_info > (3,):
spec = inspect.getfullargspec(function)
else:
spec = inspect.getargspec(function)
if len(spec.args) == 2: if len(spec.args) == 2:
self.qqDumpers[typename] = function self.qqDumpers[typename] = function
elif len(spec.args) == 3 and len(spec.defaults) == 1: elif len(spec.args) == 3 and len(spec.defaults) == 1: