Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-125716: Raise an Exception If _globals_init() Fails In the _interp…
…queues Module (gh-125802)

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)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
  • Loading branch information
ericsnowcurrently authored and miss-islington committed Oct 21, 2024
commit 6a8081c0742a30c162584cc99acbad59b250064c
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