return -1;
}
- PyThreadState *ts = PyThreadState_Get();
+ PyThreadState *ts = PyThreadState_GET();
+ assert(ts != NULL);
ctx->ctx_prev = (PyContext *)ts->context; /* borrow */
ctx->ctx_entered = 1;
return -1;
}
- PyThreadState *ts = PyThreadState_Get();
+ PyThreadState *ts = PyThreadState_GET();
+ assert(ts != NULL);
if (ts->context != (PyObject *)ctx) {
/* Can only happen if someone misuses the C API */
static inline PyContext *
context_get(void)
{
- PyThreadState *ts = PyThreadState_Get();
+ PyThreadState *ts = PyThreadState_GET();
+ assert(ts != NULL);
PyContext *current_ctx = (PyContext *)ts->context;
if (current_ctx == NULL) {
current_ctx = context_new_empty();