summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-02-19 14:08:54 (GMT)
committerGitHub <noreply@github.com>2021-02-19 14:08:54 (GMT)
commita486054b24658fa623e030ddd4cc0cbfcac54ab0 (patch)
tree54fc80da26c870385352958e0da434174bb87b2d /Include
parentacde3f1530f1664c9ec7f22e16a7f54c5191e4a6 (diff)
downloadcpython-a486054b24658fa623e030ddd4cc0cbfcac54ab0.zip
cpython-a486054b24658fa623e030ddd4cc0cbfcac54ab0.tar.gz
cpython-a486054b24658fa623e030ddd4cc0cbfcac54ab0.tar.bz2
bpo-43270: Remove private _PyErr_OCCURRED() macro (GH-24579)
Remove the private _PyErr_OCCURRED() macro: use the public PyErr_Occurred() function instead. CPython internals must use the internal _PyErr_Occurred(tstate) function instead: it is the most efficient way to check if an exception was raised.
Diffstat (limited to 'Include')
-rw-r--r--Include/pyerrors.h6
1 files changed, 0 insertions, 6 deletions
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index 979a26b..692d671 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -30,12 +30,6 @@ PyAPI_FUNC(void) PyErr_SetExcInfo(PyObject *, PyObject *, PyObject *);
macro is defined. */
PyAPI_FUNC(void) _Py_NO_RETURN Py_FatalError(const char *message);
-#if defined(Py_DEBUG) || defined(Py_LIMITED_API)
-#define _PyErr_OCCURRED() PyErr_Occurred()
-#else
-#define _PyErr_OCCURRED() (PyThreadState_GET()->curexc_type)
-#endif
-
/* Error testing and normalization */
PyAPI_FUNC(int) PyErr_GivenExceptionMatches(PyObject *, PyObject *);
PyAPI_FUNC(int) PyErr_ExceptionMatches(PyObject *);