File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,8 @@ PyContext_Enter(PyContext *ctx)
8585 return -1 ;
8686 }
8787
88- PyThreadState * ts = PyThreadState_Get ();
88+ PyThreadState * ts = PyThreadState_GET ();
89+ assert (ts != NULL );
8990
9091 ctx -> ctx_prev = (PyContext * )ts -> context ; /* borrow */
9192 ctx -> ctx_entered = 1 ;
@@ -107,7 +108,8 @@ PyContext_Exit(PyContext *ctx)
107108 return -1 ;
108109 }
109110
110- PyThreadState * ts = PyThreadState_Get ();
111+ PyThreadState * ts = PyThreadState_GET ();
112+ assert (ts != NULL );
111113
112114 if (ts -> context != (PyObject * )ctx ) {
113115 /* Can only happen if someone misuses the C API */
@@ -341,7 +343,8 @@ context_new_from_vars(PyHamtObject *vars)
341343static inline PyContext *
342344context_get (void )
343345{
344- PyThreadState * ts = PyThreadState_Get ();
346+ PyThreadState * ts = PyThreadState_GET ();
347+ assert (ts != NULL );
345348 PyContext * current_ctx = (PyContext * )ts -> context ;
346349 if (current_ctx == NULL ) {
347350 current_ctx = context_new_empty ();
You can’t perform that action at this time.
0 commit comments