mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-10 07:14:48 +03:00
Better to check of existence of signature
This commit is contained in:
parent
974b94dfd7
commit
610e8ca75c
|
@ -141,7 +141,7 @@ def value_from_object(field, obj):
|
||||||
|
|
||||||
|
|
||||||
def getargspec(obj): # type: tuple
|
def getargspec(obj): # type: tuple
|
||||||
if six.PY2:
|
if not hasattr(inspect, 'signature'):
|
||||||
parameters, _, _, defaults = inspect.getargspec(obj)
|
parameters, _, _, defaults = inspect.getargspec(obj)
|
||||||
else:
|
else:
|
||||||
signature = inspect.signature(obj)
|
signature = inspect.signature(obj)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user