Skip to content

Commit 8963a7f

Browse files
vstinnerjd
andauthored
bpo-40545: Export _PyErr_GetTopmostException() function (GH-19978)
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>
1 parent e1becf4 commit 8963a7f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Include/cpython/pyerrors.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ typedef PyOSErrorObject PyWindowsErrorObject;
7575
/* Error handling definitions */
7676

7777
PyAPI_FUNC(void) _PyErr_SetKeyError(PyObject *);
78-
_PyErr_StackItem *_PyErr_GetTopmostException(PyThreadState *tstate);
78+
PyAPI_FUNC(_PyErr_StackItem*) _PyErr_GetTopmostException(PyThreadState *tstate);
7979
PyAPI_FUNC(void) _PyErr_GetExcInfo(PyThreadState *, PyObject **, PyObject **, PyObject **);
8080

8181
/* Context manipulation (PEP 3134) */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Declare ``_PyErr_GetTopmostException()`` with ``PyAPI_FUNC()`` to properly
2+
export the function in the C API. The function remains private (``_Py``)
3+
prefix.

0 commit comments

Comments
 (0)