Commit 2e4c899e authored by Guido van Rossum's avatar Guido van Rossum

DELETE_FAST should issue an exception when the local variable is undefined.

parent 1a87e9d7
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment