mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-15 17:20:07 +01:00
Docs: replaced deprecated getargspec
This commit is contained in:
@@ -13,7 +13,7 @@ import pkgutil
|
|||||||
|
|
||||||
from buildtools.config import phoenixDir
|
from buildtools.config import phoenixDir
|
||||||
|
|
||||||
from inspect import getargspec, ismodule, getdoc, getmodule, getcomments, isfunction
|
from inspect import getfullargspec, ismodule, getdoc, getmodule, getcomments, isfunction
|
||||||
from inspect import ismethoddescriptor, getsource, ismemberdescriptor, isgetsetdescriptor
|
from inspect import ismethoddescriptor, getsource, ismemberdescriptor, isgetsetdescriptor
|
||||||
from inspect import isbuiltin, isclass, getfile, ismethod
|
from inspect import isbuiltin, isclass, getfile, ismethod
|
||||||
|
|
||||||
@@ -117,23 +117,21 @@ def analyze_params(obj, signature):
|
|||||||
return signature, param_tuple
|
return signature, param_tuple
|
||||||
|
|
||||||
try:
|
try:
|
||||||
arginfo = getargspec(obj)
|
arginfo = getfullargspec(obj)
|
||||||
# TODO: Switch to getfullargspec
|
|
||||||
except (TypeError, ValueError):
|
except (TypeError, ValueError):
|
||||||
arginfo = None
|
arginfo = None
|
||||||
|
|
||||||
pevals = {}
|
pevals = {}
|
||||||
|
|
||||||
if arginfo:
|
if arginfo:
|
||||||
args = arginfo[0]
|
args = arginfo.args
|
||||||
argsvar = arginfo[1]
|
|
||||||
|
|
||||||
if arginfo[3]:
|
if arginfo.defaults:
|
||||||
|
|
||||||
dl = len(arginfo[3])
|
dl = len(arginfo.defaults)
|
||||||
al = len(args)
|
al = len(args)
|
||||||
defargs = args[al-dl:al]
|
defargs = args[al-dl:al]
|
||||||
info = arginfo[3]
|
info = arginfo.defaults
|
||||||
|
|
||||||
for d, i in zip(defargs, info):
|
for d, i in zip(defargs, info):
|
||||||
pevals[d] = i
|
pevals[d] = i
|
||||||
|
|||||||
Reference in New Issue
Block a user