fix the Deprecation of inspect.getargspec()
This commit is contained in:
@@ -43,9 +43,9 @@ def Ntuple(description, keys, values):
|
|||||||
|
|
||||||
def get_valid_args(obj, input_args, free_keys=[]):
|
def get_valid_args(obj, input_args, free_keys=[]):
|
||||||
if inspect.isfunction(obj):
|
if inspect.isfunction(obj):
|
||||||
expected_keys = inspect.getargspec(obj)[0]
|
expected_keys = inspect.getfullargspec(obj)[0]
|
||||||
elif inspect.isclass(obj):
|
elif inspect.isclass(obj):
|
||||||
expected_keys = inspect.getargspec(obj.__init__)[0]
|
expected_keys = inspect.getfullargspec(obj.__init__)[0]
|
||||||
else:
|
else:
|
||||||
raise ValueError('Just support function and class object!')
|
raise ValueError('Just support function and class object!')
|
||||||
unexpect_keys = list()
|
unexpect_keys = list()
|
||||||
|
|||||||
Reference in New Issue
Block a user