]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40545: Export _PyErr_GetTopmostException() function (GH-19978)
authorVictor Stinner <vstinner@python.org>
Thu, 7 May 2020 13:42:33 +0000 (15:42 +0200)
committerGitHub <noreply@github.com>
Thu, 7 May 2020 13:42:33 +0000 (15:42 +0200)
Declare _PyErr_GetTopmostException() with PyAPI_FUNC() to properly
export the function in the C API. The function remains private
("_Py") prefix.

Co-Authored-By: Julien Danjou <julien@danjou.info>
Include/cpython/pyerrors.h
Misc/NEWS.d/next/C API/2020-05-07-11-41-13.bpo-40545.51DzF1.rst [new file with mode: 0644]

index cdd052026c1ba243c8b1f84ceffa3eff0135294b..dd3c2caa0cc043517bed788adeb0d8969bae02b2 100644 (file)
@@ -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 (file)
index 0000000..d7f256a
--- /dev/null
@@ -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.