Skip to content

Commit

Permalink
pythongh-125716: Raise an Exception If _globals_init() Fails In the _…
Browse files Browse the repository at this point in the history
…interpqueues Module (pythongh-125802)

The fix applies to the _interpchannels module as well.

I've also included a drive-by typo fix for _interpqueues.
  • Loading branch information
ericsnowcurrently authored Oct 21, 2024
1 parent 9dde463 commit 44f841f
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 44f841f

Please sign in to comment.