_channel_new (line 1117) returns NULL from PyMem_NEW without calling PyErr_NoMemory(). Assertion fires in handle_channel_error.
import _testcapi, _interpchannels as ch
for n in range(1, 80):
_testcapi.set_nomemory(n, 0)
try:
cid = ch.create()
_testcapi.remove_mem_hooks()
ch.destroy(cid)
break
except MemoryError:
_testcapi.remove_mem_hooks()
except:
_testcapi.remove_mem_hooks()
# Assertion in handle_channel_error