Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Include/cpython/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ typedef enum {
} PyContextEvent;

/*
* A Callback to clue in non-python contexts impls about a
* change in the active python context.
* A Callback to signal non-python contexts impls when a context
* object undergoes a PyContext_Enter or PyContext_Exit
*
* The callback is invoked with the event and a reference to =
* The callback is invoked with the event and a reference to
* the context after its entered and before its exited.
*
* if the callback returns with an exception set, it must return -1. Otherwise
Expand Down
4 changes: 3 additions & 1 deletion Python/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ context_event_name(PyContextEvent event) {
static void notify_context_watchers(PyContextEvent event, PyContext *ctx)
{
assert(Py_REFCNT(ctx) > 0);
PyInterpreterState *interp = _PyInterpreterState_GET();
PyThreadState *ts = _PyThreadState_GET();
assert(ts != NULL);
PyInterpreterState *interp = ts->interp;
assert(interp->_initialized);
uint8_t bits = interp->active_context_watchers;
int i = 0;
Expand Down
Loading