]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-125716: Raise an Exception If _globals_init() Fails In the _interpqueues Module...
authorEric Snow <ericsnowcurrently@gmail.com>
Mon, 21 Oct 2024 19:39:07 +0000 (13:39 -0600)
committerGitHub <noreply@github.com>
Mon, 21 Oct 2024 19:39:07 +0000 (19:39 +0000)
The fix applies to the _interpchannels module as well.

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

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 55c43199ee4d7961297cd41a48baf577fe2406d4..aa70134d82b046a4bedee1d11d0e3c6a9e033bb3 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;
     }