From d50fb33660c515dbc371817ea3be1f282a715b2b Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Thu, 19 Nov 2015 20:13:41 -0800 Subject: [PATCH] Fixed arg count compatibility in Python3 --- graphene/relay/types.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/graphene/relay/types.py b/graphene/relay/types.py index 8e86f362..a803d2f3 100644 --- a/graphene/relay/types.py +++ b/graphene/relay/types.py @@ -1,3 +1,4 @@ +import inspect import warnings from functools import wraps from graphql_relay.node.node import to_global_id @@ -82,7 +83,8 @@ class BaseNode(object): if isinstance(get_node, staticmethod): 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" " in future versions of graphene".format(cls.__name__), FutureWarning)