Skip to content

Commit d3b889f

Browse files
committed
gh-124872: Move PyThreadState to first argument for consistency
1 parent 120729d commit d3b889f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Python/context.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ context_event_name(PyContextEvent event) {
112112
Py_UNREACHABLE();
113113
}
114114

115-
static void notify_context_watchers(PyContextEvent event, PyContext *ctx, PyThreadState *ts)
115+
static void
116+
notify_context_watchers(PyThreadState *ts, PyContextEvent event, PyContext *ctx)
116117
{
117118
assert(Py_REFCNT(ctx) > 0);
118119
PyInterpreterState *interp = ts->interp;
@@ -192,7 +193,7 @@ _PyContext_Enter(PyThreadState *ts, PyObject *octx)
192193
ts->context = Py_NewRef(ctx);
193194
ts->context_ver++;
194195

195-
notify_context_watchers(Py_CONTEXT_EVENT_ENTER, ctx, ts);
196+
notify_context_watchers(ts, Py_CONTEXT_EVENT_ENTER, ctx);
196197
return 0;
197198
}
198199

@@ -226,7 +227,7 @@ _PyContext_Exit(PyThreadState *ts, PyObject *octx)
226227
return -1;
227228
}
228229

229-
notify_context_watchers(Py_CONTEXT_EVENT_EXIT, ctx, ts);
230+
notify_context_watchers(ts, Py_CONTEXT_EVENT_EXIT, ctx);
230231
Py_SETREF(ts->context, (PyObject *)ctx->ctx_prev);
231232
ts->context_ver++;
232233

0 commit comments

Comments
 (0)