Skip to content

Commit 25b178a

Browse files
committed
Remove the now-redundant (and incorrect) branch from
handle_channel_error Tested locally with: def test_lock_allocation_failure(self): import _testcapi for n in range(0, 100): cid = None try: _testcapi.set_nomemory(n, n+1) cid = _channels.create() except MemoryError: pass finally: _testcapi.remove_mem_hooks() if cid is not None: _channels.close(cid, force=True) _channels.destroy(cid)
1 parent b9182d3 commit 25b178a

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

Modules/_interpchannelsmodule.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,6 @@ handle_channel_error(int err, PyObject *mod, int64_t cid)
427427
"if not empty (try force=True)",
428428
cid);
429429
}
430-
else if (err == ERR_CHANNEL_MUTEX_ALLOC_FAIL) {
431-
PyErr_NoMemory();
432-
}
433430
else if (err == ERR_CHANNELS_MUTEX_INIT) {
434431
PyErr_SetString(state->ChannelError,
435432
"can't initialize mutex for channel management");

0 commit comments

Comments
 (0)