mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	Disallow function calls like foo(None=1).
Backport from py3k rev. 55708 by Guido.
This commit is contained in:
		
							parent
							
								
									ab8e279ba6
								
							
						
					
					
						commit
						e06cf4534f
					
				
					 2 changed files with 7 additions and 0 deletions
				
			
		|  | @ -1869,6 +1869,10 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func) | |||
|                     return NULL; | ||||
|                 } | ||||
|                 key = e->v.Name.id; | ||||
|                 if (!strcmp(PyString_AS_STRING(key), "None")) { | ||||
|                     ast_error(CHILD(ch, 0), "assignment to None"); | ||||
|                     return NULL; | ||||
|                 } | ||||
|                 e = ast_for_expr(c, CHILD(ch, 2)); | ||||
|                 if (!e) | ||||
|                     return NULL; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Georg Brandl
						Georg Brandl