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

This commit is contained in:
Guido van Rossum 1998-05-12 20:27:36 +00:00
parent 1a87e9d708
commit 2e4c899e2d

View file

@ -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;