File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -112,11 +112,9 @@ context_event_name(PyContextEvent event) {
112112 Py_UNREACHABLE ();
113113}
114114
115- static void notify_context_watchers (PyContextEvent event , PyContext * ctx )
115+ static void notify_context_watchers (PyContextEvent event , PyContext * ctx , PyThreadState * ts )
116116{
117117 assert (Py_REFCNT (ctx ) > 0 );
118- PyThreadState * ts = _PyThreadState_GET ();
119- assert (ts != NULL );
120118 PyInterpreterState * interp = ts -> interp ;
121119 assert (interp -> _initialized );
122120 uint8_t bits = interp -> active_context_watchers ;
@@ -194,7 +192,7 @@ _PyContext_Enter(PyThreadState *ts, PyObject *octx)
194192 ts -> context = Py_NewRef (ctx );
195193 ts -> context_ver ++ ;
196194
197- notify_context_watchers (Py_CONTEXT_EVENT_ENTER , ctx );
195+ notify_context_watchers (Py_CONTEXT_EVENT_ENTER , ctx , ts );
198196 return 0 ;
199197}
200198
@@ -228,7 +226,7 @@ _PyContext_Exit(PyThreadState *ts, PyObject *octx)
228226 return -1 ;
229227 }
230228
231- notify_context_watchers (Py_CONTEXT_EVENT_EXIT , ctx );
229+ notify_context_watchers (Py_CONTEXT_EVENT_EXIT , ctx , ts );
232230 Py_SETREF (ts -> context , (PyObject * )ctx -> ctx_prev );
233231 ts -> context_ver ++ ;
234232
You can’t perform that action at this time.
0 commit comments