mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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];
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue