mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +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;
|
||||
|
||||
case DELETE_FAST:
|
||||
x = GETLOCAL(oparg);
|
||||
if (x == NULL) {
|
||||
PyErr_SetObject(PyExc_NameError,
|
||||
PyTuple_GetItem(co->co_varnames,
|
||||
oparg));
|
||||
break;
|
||||
}
|
||||
SETLOCAL(oparg, NULL);
|
||||
continue;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue