Commit 59c900d3 authored by Antoine Pitrou's avatar Antoine Pitrou

Fix macro expansion of _PyErr_OCCURRED(), and make sure to use it in at least...

Fix macro expansion of _PyErr_OCCURRED(), and make sure to use it in at least one place so as to avoid regressions.
parent c377fe2b
...@@ -100,7 +100,7 @@ PyAPI_FUNC(void) Py_FatalError(const char *message) _Py_NO_RETURN; ...@@ -100,7 +100,7 @@ PyAPI_FUNC(void) Py_FatalError(const char *message) _Py_NO_RETURN;
#if defined(Py_DEBUG) || defined(Py_LIMITED_API) #if defined(Py_DEBUG) || defined(Py_LIMITED_API)
#define _PyErr_OCCURRED() PyErr_Occurred() #define _PyErr_OCCURRED() PyErr_Occurred()
#else #else
#define _PyErr_OCCURRED() (_PyThreadState_Current->curexc_type) #define _PyErr_OCCURRED() (PyThreadState_GET()->curexc_type)
#endif #endif
/* Error testing and normalization */ /* Error testing and normalization */
......
...@@ -12,6 +12,9 @@ What's New in Python 3.3.3 release candidate 1? ...@@ -12,6 +12,9 @@ What's New in Python 3.3.3 release candidate 1?
Core and Builtins Core and Builtins
----------------- -----------------
- Fix macro expansion of _PyErr_OCCURRED(), and make sure to use it in at
least one place so as to avoid regressions.
- Issue #19014: memoryview.cast() is now allowed on zero-length views. - Issue #19014: memoryview.cast() is now allowed on zero-length views.
- Issue #19098: Prevent overflow in the compiler when the recursion limit is set - Issue #19098: Prevent overflow in the compiler when the recursion limit is set
......
...@@ -2083,7 +2083,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) ...@@ -2083,7 +2083,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
} }
else { else {
x = PyObject_GetItem(v, w); x = PyObject_GetItem(v, w);
if (x == NULL && PyErr_Occurred()) { if (x == NULL && _PyErr_OCCURRED()) {
if (!PyErr_ExceptionMatches( if (!PyErr_ExceptionMatches(
PyExc_KeyError)) PyExc_KeyError))
break; break;
...@@ -2127,7 +2127,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) ...@@ -2127,7 +2127,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
(PyDictObject *)f->f_builtins, (PyDictObject *)f->f_builtins,
w); w);
if (x == NULL) { if (x == NULL) {
if (!PyErr_Occurred()) if (!_PyErr_OCCURRED())
format_exc_check_arg(PyExc_NameError, format_exc_check_arg(PyExc_NameError,
GLOBAL_NAME_ERROR_MSG, w); GLOBAL_NAME_ERROR_MSG, w);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment