cpython: 2aee9c41bb79 (original) (raw)
Mercurial > cpython
changeset 86140:2aee9c41bb79 3.3
Fix macro expansion of _PyErr_OCCURRED(), and make sure to use it in at least one place so as to avoid regressions.
Antoine Pitrou solipsis@pitrou.net | |
---|---|
date | Mon, 07 Oct 2013 20:38:51 +0200 |
parents | b4444d16e333 |
children | 19954e5dbef5 b6205505e1e4 |
files | Include/pyerrors.h Misc/NEWS Python/ceval.c |
diffstat | 3 files changed, 6 insertions(+), 3 deletions(-)[+] [-] Include/pyerrors.h 2 Misc/NEWS 3 Python/ceval.c 4 |
line wrap: on
line diff
--- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -100,7 +100,7 @@ PyAPI_FUNC(void) Py_FatalError(const cha #if defined(Py_DEBUG) || defined(Py_LIMITED_API) #define _PyErr_OCCURRED() PyErr_Occurred() #else -#define _PyErr_OCCURRED() (_PyThreadState_Current->curexc_type) +#define _PyErr_OCCURRED() (PyThreadState_GET()->curexc_type) #endif /* Error testing and normalization */
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -12,6 +12,9 @@ What's New in Python 3.3.3 release candi Core and Builtins ----------------- +- Fix macro expansion of _PyErr_OCCURRED(), and make sure to use it in at
- Issue #19014: memoryview.cast() is now allowed on zero-length views.
- Issue #19098: Prevent overflow in the compiler when the recursion limit is set
--- a/Python/ceval.c +++ b/Python/ceval.c @@ -2083,7 +2083,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int } else { x = PyObject_GetItem(v, w);
if (x == NULL && PyErr_Occurred()) {[](#l3.7)
if (x == NULL && _PyErr_OCCURRED()) {[](#l3.8) if (!PyErr_ExceptionMatches([](#l3.9) PyExc_KeyError))[](#l3.10) break;[](#l3.11)
@@ -2127,7 +2127,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int (PyDictObject *)f->f_builtins, w); if (x == NULL) {
if (!PyErr_Occurred())[](#l3.16)
if (!_PyErr_OCCURRED())[](#l3.17) format_exc_check_arg(PyExc_NameError,[](#l3.18) GLOBAL_NAME_ERROR_MSG, w);[](#l3.19) break;[](#l3.20)