[issue45711] Simplify the interpreter's (type, val, tb) exception representation

Irit Katriel report at bugs.python.org
Tue Feb 1 14:52:16 EST 2022


Irit Katriel <iritkatriel at gmail.com> added the comment:

> GH-30531 proposes adding PyErr_GetActiveException() function which has no parameter, but Cython __Pyx_PyErr_GetTopmostException() has a tstate parameter.


I've now updated it to follow the pattern of other functions, where the is a private function that takes tstate and the public function calls it.

So it adds in Include/pyerrors.h 

PyAPI_FUNC(PyObject*) PyErr_GetActiveException(void);
PyAPI_FUNC(void) PyErr_SetActiveException(PyObject *);

and in Include/cpython/pyerrors.h

PyAPI_FUNC(PyObject*) _PyErr_GetActiveException(PyThreadState *);
PyAPI_FUNC(void) _PyErr_SetActiveException(PyThreadState *, PyObject *);

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45711>
_______________________________________


More information about the Python-bugs-list mailing list