From: Guido van Rossum Date: Tue, 12 May 1998 20:27:36 +0000 (+0000) Subject: DELETE_FAST should issue an exception when the local variable is undefined. X-Git-Tag: v1.5.2a1~655 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e4c899e2d28f2acbd62f7b1353dd96df803d911;p=python DELETE_FAST should issue an exception when the local variable is undefined. --- diff --git a/Python/ceval.c b/Python/ceval.c index 05275373cd..7c358dbd93 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -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;