summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-05-12 20:27:36 (GMT)
committerGuido van Rossum <guido@python.org>1998-05-12 20:27:36 (GMT)
commit2e4c899e2d28f2acbd62f7b1353dd96df803d911 (patch)
tree7cd67ce6413032f895835f29a8c18c214f0ef08a /Python/ceval.c
parent1a87e9d708dae6936e87ffcb8e73515c2099efdc (diff)
downloadcpython-2e4c899e2d28f2acbd62f7b1353dd96df803d911.zip
cpython-2e4c899e2d28f2acbd62f7b1353dd96df803d911.tar.gz
cpython-2e4c899e2d28f2acbd62f7b1353dd96df803d911.tar.bz2
DELETE_FAST should issue an exception when the local variable is undefined.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 0527537..7c358db 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;