Skip to content

Commit

Permalink
[3.13] pythongh-125716: Raise an Exception If _globals_init() Fails I…
Browse files Browse the repository at this point in the history
…n the _interpqueues Module (pythongh-125808)

The fix applies to the _interpchannels module as well.

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

(cherry picked from commit 44f841f, AKA pythongh-125802)

Co-authored-by: Eric Snow <[email protected]>
  • Loading branch information
miss-islington and ericsnowcurrently authored Oct 21, 2024
1 parent 8257ecd commit b752764
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Modules/_interpchannelsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
5 changes: 3 additions & 2 deletions Modules/_interpqueuesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit b752764

Please sign in to comment.