Skip to content

Commit

Permalink
fixup! gh-119333: Back up exception before calling PyContext_WatchCal…
Browse files Browse the repository at this point in the history
…lback
  • Loading branch information
rhansen committed Sep 30, 2024
1 parent 66fdcf5 commit ffa8cc8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Doc/c-api/contextvars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ Context object management functions:
Otherwise, the callback is invoked before the deactivation of *ctx* as the current context
and the restoration of the previous contex object for the current thread.
If the callback raises an exception it will be ignored.
Any pending exception is cleared before the callback is called and restored
after the callback returns.
If the callback raises an exception it will be ignored.
.. versionadded:: 3.14
Expand Down
4 changes: 2 additions & 2 deletions Include/cpython/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ typedef enum {
* The callback is invoked with the event and a reference to
* the context after its entered and before its exited.
*
* If the callback raises an exception it will be ignored.
*
* Any pending exception is cleared before the callback is called and restored
* after the callback returns.
*
* If the callback raises an exception it will be ignored.
*/
typedef void (*PyContext_WatchCallback)(PyContextEvent, PyContext *);

Expand Down

0 comments on commit ffa8cc8

Please sign in to comment.