mirror of
https://github.com/python/cpython.git
synced 2025-08-28 12:45:07 +00:00
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:
parent
c377fe2b96
commit
59c900d3bf
3 changed files with 6 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue