mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Mangle __parameters in __annotations__ dict properly. Issue #20625.
This commit is contained in:
		
							parent
							
								
									ee227ae7cf
								
							
						
					
					
						commit
						026019f89b
					
				
					 5 changed files with 37 additions and 1 deletions
				
			
		|  | @ -1533,8 +1533,14 @@ compiler_visit_argannotation(struct compiler *c, identifier id, | |||
| { | ||||
|     if (annotation) { | ||||
|         VISIT(c, expr, annotation); | ||||
|         if (PyList_Append(names, id)) | ||||
|         PyObject *mangled = _Py_Mangle(c->u->u_private, id); | ||||
|         if (!mangled) | ||||
|             return -1; | ||||
|         if (PyList_Append(names, mangled) < 0) { | ||||
|             Py_DECREF(mangled); | ||||
|             return -1; | ||||
|         } | ||||
|         Py_DECREF(mangled); | ||||
|     } | ||||
|     return 0; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yury Selivanov
						Yury Selivanov