mirror of
				https://github.com/graphql-python/graphene.git
				synced 2025-11-04 09:57:41 +03:00 
			
		
		
		
	Fixed arg count compatibility in Python3
This commit is contained in:
		
							parent
							
								
									0d4164648f
								
							
						
					
					
						commit
						d50fb33660
					
				| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user