Skip to content

Commit d50fb33

Browse files
committed
Fixed arg count compatibility in Python3
1 parent 0d41646 commit d50fb33

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

graphene/relay/types.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import inspect
12
import warnings
23
from functools import wraps
34
from graphql_relay.node.node import to_global_id
@@ -82,7 +83,8 @@ def _prepare_class(cls):
8283
if isinstance(get_node, staticmethod):
8384
args -= 1
8485

85-
if get_node.func_code.co_argcount < args:
86+
get_node_num_args = len(inspect.getargspec(get_node).args)
87+
if get_node_num_args < args:
8688
warnings.warn("get_node will receive also the info arg"
8789
" in future versions of graphene".format(cls.__name__),
8890
FutureWarning)

0 commit comments

Comments
 (0)