Don't stomp on an exception set by PyCell_Get()

This commit is contained in:
Jeremy Hylton 2002-07-11 16:56:38 +00:00
parent 7b4c8e485c
commit 76c81eecfa

View file

@ -1734,6 +1734,10 @@ eval_frame(PyFrameObject *f)
x = freevars[oparg];
w = PyCell_Get(x);
if (w == NULL) {
err = -1;
/* Don't stomp existing exception */
if (PyErr_Occurred())
break;
if (oparg < f->f_ncells) {
v = PyTuple_GetItem(co->co_cellvars,
oparg);
@ -1750,7 +1754,6 @@ eval_frame(PyFrameObject *f)
UNBOUNDFREE_ERROR_MSG,
v);
}
err = -1;
break;
}
PUSH(w);