Fixed arg count compatibility in Python3

This commit is contained in:
Syrus Akbary 2015-11-19 20:13:41 -08:00
parent 0d4164648f
commit d50fb33660

View File

@ -1,3 +1,4 @@
import inspect
import warnings import warnings
from functools import wraps from functools import wraps
from graphql_relay.node.node import to_global_id from graphql_relay.node.node import to_global_id
@ -82,7 +83,8 @@ class BaseNode(object):
if isinstance(get_node, staticmethod): if isinstance(get_node, staticmethod):
args -= 1 args -= 1
if get_node.func_code.co_argcount < args: get_node_num_args = len(inspect.getargspec(get_node).args)
if get_node_num_args < args:
warnings.warn("get_node will receive also the info arg" warnings.warn("get_node will receive also the info arg"
" in future versions of graphene".format(cls.__name__), " in future versions of graphene".format(cls.__name__),
FutureWarning) FutureWarning)