mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Don't stomp on an exception set by PyCell_Get()
This commit is contained in:
parent
7b4c8e485c
commit
76c81eecfa
1 changed files with 4 additions and 1 deletions
|
@ -1734,6 +1734,10 @@ eval_frame(PyFrameObject *f)
|
||||||
x = freevars[oparg];
|
x = freevars[oparg];
|
||||||
w = PyCell_Get(x);
|
w = PyCell_Get(x);
|
||||||
if (w == NULL) {
|
if (w == NULL) {
|
||||||
|
err = -1;
|
||||||
|
/* Don't stomp existing exception */
|
||||||
|
if (PyErr_Occurred())
|
||||||
|
break;
|
||||||
if (oparg < f->f_ncells) {
|
if (oparg < f->f_ncells) {
|
||||||
v = PyTuple_GetItem(co->co_cellvars,
|
v = PyTuple_GetItem(co->co_cellvars,
|
||||||
oparg);
|
oparg);
|
||||||
|
@ -1750,7 +1754,6 @@ eval_frame(PyFrameObject *f)
|
||||||
UNBOUNDFREE_ERROR_MSG,
|
UNBOUNDFREE_ERROR_MSG,
|
||||||
v);
|
v);
|
||||||
}
|
}
|
||||||
err = -1;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
PUSH(w);
|
PUSH(w);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue