From 610e8ca75ca9ad8fd70c88a4785965cd5e0fd5dd Mon Sep 17 00:00:00 2001 From: Alireza Savand Date: Thu, 22 Sep 2016 13:10:02 +0400 Subject: [PATCH] Better to check of existence of `signature` --- rest_framework/compat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/compat.py b/rest_framework/compat.py index 2f7961ca2..c278448fd 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -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)