Better to check of existence of signature

This commit is contained in:
Alireza Savand 2016-09-22 13:10:02 +04:00
parent 974b94dfd7
commit 610e8ca75c

View File

@ -141,7 +141,7 @@ def value_from_object(field, obj):
def getargspec(obj): # type: tuple
if six.PY2:
if not hasattr(inspect, 'signature'):
parameters, _, _, defaults = inspect.getargspec(obj)
else:
signature = inspect.signature(obj)