https://github.com/python/cpython/commit/62d5a53a0b2a5262a86984cfe9817aeb653ebfca
commit: 62d5a53a0b2a5262a86984cfe9817aeb653ebfca
branch: main
author: Richard Hansen <[email protected]>
committer: 1st1 <[email protected]>
date: 2024-10-12T12:33:00-07:00
summary:

gh-124872: Move PyThreadState to first argument for consistency (#124774)

files:
M Python/context.c

diff --git a/Python/context.c b/Python/context.c
index 36e2677c398f59..9b742136b0726d 100644
--- a/Python/context.c
+++ b/Python/context.c
@@ -112,7 +112,8 @@ context_event_name(PyContextEvent event) {
     Py_UNREACHABLE();
 }
 
-static void notify_context_watchers(PyContextEvent event, PyContext *ctx, 
PyThreadState *ts)
+static void
+notify_context_watchers(PyThreadState *ts, PyContextEvent event, PyContext 
*ctx)
 {
     assert(Py_REFCNT(ctx) > 0);
     PyInterpreterState *interp = ts->interp;
@@ -192,7 +193,7 @@ _PyContext_Enter(PyThreadState *ts, PyObject *octx)
     ts->context = Py_NewRef(ctx);
     ts->context_ver++;
 
-    notify_context_watchers(Py_CONTEXT_EVENT_ENTER, ctx, ts);
+    notify_context_watchers(ts, Py_CONTEXT_EVENT_ENTER, ctx);
     return 0;
 }
 
@@ -226,7 +227,7 @@ _PyContext_Exit(PyThreadState *ts, PyObject *octx)
         return -1;
     }
 
-    notify_context_watchers(Py_CONTEXT_EVENT_EXIT, ctx, ts);
+    notify_context_watchers(ts, Py_CONTEXT_EVENT_EXIT, ctx);
     Py_SETREF(ts->context, (PyObject *)ctx->ctx_prev);
     ts->context_ver++;
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to