Fix macro expansion of _PyErr_OCCURRED(), and make sure to use it in at least one place so as to avoid regressions.

This commit is contained in:
Antoine Pitrou 2013-10-07 20:38:51 +02:00
parent c377fe2b96
commit 59c900d3bf
3 changed files with 6 additions and 3 deletions

View file

@ -2083,7 +2083,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
}
else {
x = PyObject_GetItem(v, w);
if (x == NULL && PyErr_Occurred()) {
if (x == NULL && _PyErr_OCCURRED()) {
if (!PyErr_ExceptionMatches(
PyExc_KeyError))
break;
@ -2127,7 +2127,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
(PyDictObject *)f->f_builtins,
w);
if (x == NULL) {
if (!PyErr_Occurred())
if (!_PyErr_OCCURRED())
format_exc_check_arg(PyExc_NameError,
GLOBAL_NAME_ERROR_MSG, w);
break;