8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e02793 commit 11c500bCopy full SHA for 11c500b
Python/context.c
@@ -202,9 +202,8 @@ _PyContext_Enter(PyThreadState *ts, PyContext *ctx)
202
return -1;
203
}
204
205
- ctx->ctx_prev = ts->context; /* borrow */
206
ctx->ctx_entered = 1;
207
-
+ ctx->ctx_prev = ts->context; /* steal */
208
ts->context = Py_NewRef(ctx);
209
context_switched(ts);
210
return 0;
@@ -238,8 +237,7 @@ _PyContext_Exit(PyThreadState *ts, PyContext *ctx)
238
237
239
240
241
- Py_SETREF(ts->context, ctx->ctx_prev);
242
+ Py_SETREF(ts->context, ctx->ctx_prev); /* steal */
243
ctx->ctx_prev = NULL;
244
ctx->ctx_entered = 0;
245
0 commit comments