From 72b1a5ed1b86f2e61263267c57b4ba85147a944e Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 7 May 2020 11:39:43 +0200 Subject: [PATCH] bpo-40545: Export _PyErr_GetTopmostException() function Declare _PyErr_GetTopmostException() with PyAPI_FUNC() to properly export the function in the C API. The function remains private ("_Py") prefix. --- Include/cpython/pyerrors.h | 2 +- .../NEWS.d/next/C API/2020-05-07-11-41-13.bpo-40545.51DzF1.rst | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/C API/2020-05-07-11-41-13.bpo-40545.51DzF1.rst diff --git a/Include/cpython/pyerrors.h b/Include/cpython/pyerrors.h index cdd052026c1ba2..dd3c2caa0cc043 100644 --- a/Include/cpython/pyerrors.h +++ b/Include/cpython/pyerrors.h @@ -75,7 +75,7 @@ typedef PyOSErrorObject PyWindowsErrorObject; /* Error handling definitions */ PyAPI_FUNC(void) _PyErr_SetKeyError(PyObject *); -_PyErr_StackItem *_PyErr_GetTopmostException(PyThreadState *tstate); +PyAPI_FUNC(_PyErr_StackItem*) _PyErr_GetTopmostException(PyThreadState *tstate); PyAPI_FUNC(void) _PyErr_GetExcInfo(PyThreadState *, PyObject **, PyObject **, PyObject **); /* Context manipulation (PEP 3134) */ diff --git a/Misc/NEWS.d/next/C API/2020-05-07-11-41-13.bpo-40545.51DzF1.rst b/Misc/NEWS.d/next/C API/2020-05-07-11-41-13.bpo-40545.51DzF1.rst new file mode 100644 index 00000000000000..d7f256a2a6b527 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-05-07-11-41-13.bpo-40545.51DzF1.rst @@ -0,0 +1,3 @@ +Declare ``_PyErr_GetTopmostException()`` with ``PyAPI_FUNC()`` to properly +export the function in the C API. The function remains private (``_Py``) +prefix.