mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	DELETE_FAST should issue an exception when the local variable is undefined.
This commit is contained in:
		
							parent
							
								
									1a87e9d708
								
							
						
					
					
						commit
						2e4c899e2d
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		|  | @ -1337,6 +1337,13 @@ eval_code2(co, globals, locals, | ||||||
| 			continue; | 			continue; | ||||||
| 
 | 
 | ||||||
| 		case DELETE_FAST: | 		case DELETE_FAST: | ||||||
|  | 			x = GETLOCAL(oparg); | ||||||
|  | 			if (x == NULL) { | ||||||
|  | 				PyErr_SetObject(PyExc_NameError, | ||||||
|  | 					   PyTuple_GetItem(co->co_varnames, | ||||||
|  | 							oparg)); | ||||||
|  | 				break; | ||||||
|  | 			} | ||||||
| 			SETLOCAL(oparg, NULL); | 			SETLOCAL(oparg, NULL); | ||||||
| 			continue; | 			continue; | ||||||
| 		 | 		 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum