diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2024-10-21 19:39:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-21 19:39:07 (GMT) |
commit | 44f841f01af0fb038e142a07f15eda1ecdd5b08a (patch) | |
tree | 37a3fcc160bebf70dc7c2d152e79c8b7a6314ae1 /Modules | |
parent | 9dde4638e44639d45bd7d72e70a8d410995a585a (diff) | |
download | cpython-44f841f01af0fb038e142a07f15eda1ecdd5b08a.zip cpython-44f841f01af0fb038e142a07f15eda1ecdd5b08a.tar.gz cpython-44f841f01af0fb038e142a07f15eda1ecdd5b08a.tar.bz2 |
gh-125716: Raise an Exception If _globals_init() Fails In the _interpqueues Module (gh-125802)
The fix applies to the _interpchannels module as well.
I've also included a drive-by typo fix for _interpqueues.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_interpchannelsmodule.c | 3 | ||||
-rw-r--r-- | Modules/_interpqueuesmodule.c | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/Modules/_interpchannelsmodule.c b/Modules/_interpchannelsmodule.c index a8b4a8d..c52cde6 100644 --- a/Modules/_interpchannelsmodule.c +++ b/Modules/_interpchannelsmodule.c @@ -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; } diff --git a/Modules/_interpqueuesmodule.c b/Modules/_interpqueuesmodule.c index 55c4319..aa70134 100644 --- a/Modules/_interpqueuesmodule.c +++ b/Modules/_interpqueuesmodule.c @@ -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; } |