]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-99984: Fix Compiler Warnings (#100036)
authorEric Snow <ericsnowcurrently@gmail.com>
Mon, 5 Dec 2022 21:41:06 +0000 (14:41 -0700)
committerGitHub <noreply@github.com>
Mon, 5 Dec 2022 21:41:06 +0000 (14:41 -0700)
https://github.com/python/cpython/issues/99984

Modules/_xxsubinterpretersmodule.c

index d7d7fcaf00a81a21991e9350145e829ac550ea35..0892fa3a9595e81100b6fe4a39b0ed8d2fb6facf 100644 (file)
@@ -2583,7 +2583,7 @@ channel_create(PyObject *self, PyObject *Py_UNUSED(ignored))
 {
     int64_t cid = _channel_create(&_globals.channels);
     if (cid < 0) {
-        (void)handle_channel_error(cid, self, -1);
+        (void)handle_channel_error(-1, self, cid);
         return NULL;
     }
     module_state *state = get_module_state(self);
@@ -2985,6 +2985,11 @@ module_exec(PyObject *mod)
         return -1;
     }
 
+    module_state *state = get_module_state(mod);
+    if (state == NULL) {
+        goto error;
+    }
+
     /* Add exception types */
     if (interp_exceptions_init(mod) != 0) {
         goto error;
@@ -2994,7 +2999,6 @@ module_exec(PyObject *mod)
     }
 
     /* Add other types */
-    module_state *state = get_module_state(mod);
 
     // ChannelID
     state->ChannelIDType = add_new_type(