]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-125716: Raise an Exception If _globals_init() Fails In the _interpqueues...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 21 Oct 2024 20:05:06 +0000 (22:05 +0200)
committerGitHub <noreply@github.com>
Mon, 21 Oct 2024 20:05:06 +0000 (20:05 +0000)
The fix applies to the _interpchannels module as well.

I've also included a drive-by typo fix for _interpqueues.

(cherry picked from commit 44f841f01af0fb038e142a07f15eda1ecdd5b08a, AKA gh-125802)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Modules/_interpchannelsmodule.c
Modules/_interpqueuesmodule.c

index a8b4a8d76b0eaab85ee24ecaa3a84098e1aa7d30..c52cde6da500f7d115befaaced0629f225940c27 100644 (file)
@@ -3482,7 +3482,8 @@ The 'interpreters' module provides a more convenient interface.");
 static int
 module_exec(PyObject *mod)
 {
-    if (_globals_init() != 0) {
+    int err = _globals_init();
+    if (handle_channel_error(err, mod, -1)) {
         return -1;
     }
 
index aebfd1337ba997703316e1c031c6d0931dafbf8a..c766cb281819da00acb76afe9789ff40cdac02c2 100644 (file)
@@ -1312,7 +1312,7 @@ _queueid_xid_new(int64_t qid)
 
     struct _queueid_xid *data = PyMem_RawMalloc(sizeof(struct _queueid_xid));
     if (data == NULL) {
-        _queues_incref(queues, qid);
+        _queues_decref(queues, qid);
         return NULL;
     }
     data->qid = qid;
@@ -1894,7 +1894,8 @@ The 'interpreters' module provides a more convenient interface.");
 static int
 module_exec(PyObject *mod)
 {
-    if (_globals_init() != 0) {
+    int err = _globals_init();
+    if (handle_queue_error(err, mod, -1)) {
         return -1;
     }