diff options
author | Julien Danjou <julien@danjou.info> | 2020-11-02 14:16:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-02 14:16:25 (GMT) |
commit | 64366fa9b3ba71b8a503a8719eff433f4ea49eb9 (patch) | |
tree | 8aa6d76484553d2f29bfe5d03709a86c0abe547f /Include/cpython/pystate.h | |
parent | 3d86d090dcbbdfdd3e5a5951cab30612d6131222 (diff) | |
download | cpython-64366fa9b3ba71b8a503a8719eff433f4ea49eb9.zip cpython-64366fa9b3ba71b8a503a8719eff433f4ea49eb9.tar.gz cpython-64366fa9b3ba71b8a503a8719eff433f4ea49eb9.tar.bz2 |
bpo-41435: Add sys._current_exceptions() function (GH-21689)
This adds a new function named sys._current_exceptions() which is equivalent ot
sys._current_frames() except that it returns the exceptions currently handled
by other threads. It is equivalent to calling sys.exc_info() for each running
thread.
Diffstat (limited to 'Include/cpython/pystate.h')
-rw-r--r-- | Include/cpython/pystate.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h index 5d5e4e3..25522b4 100644 --- a/Include/cpython/pystate.h +++ b/Include/cpython/pystate.h @@ -167,6 +167,11 @@ PyAPI_FUNC(PyInterpreterState *) _PyGILState_GetInterpreterStateUnsafe(void); */ PyAPI_FUNC(PyObject *) _PyThread_CurrentFrames(void); +/* The implementation of sys._current_exceptions() Returns a dict mapping + thread id to that thread's current exception. +*/ +PyAPI_FUNC(PyObject *) _PyThread_CurrentExceptions(void); + /* Routines for advanced debuggers, requested by David Beazley. Don't use unless you know what you are doing! */ PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Main(void); |