use error label instead of breaking eval loop (closes #16693)

This commit is contained in:
Benjamin Peterson 2012-12-15 12:51:05 -05:00
parent 1a714750cf
commit 9272279afd
2 changed files with 7 additions and 3 deletions

View file

@ -2162,9 +2162,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
else {
v = PyObject_GetItem(locals, name);
if (v == NULL && PyErr_Occurred()) {
if (!PyErr_ExceptionMatches(
PyExc_KeyError))
break;
if (!PyErr_ExceptionMatches(PyExc_KeyError))
goto error;
PyErr_Clear();
}
}