Skip to content
Open
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
7 changes: 7 additions & 0 deletions Lib/test/test_interpreters/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,13 @@ def test_failure(self):
with self.assertRaises(ExecutionFailed):
interp.exec('raise Exception')

def test_failure_memoryerror(self):
interp = interpreters.create()
with self.assertRaises(ExecutionFailed) as cm:
interp.exec('raise MemoryError("spam")')
self.assertEqual(cm.exception.excinfo.type.__name__, 'MemoryError')
self.assertEqual(cm.exception.excinfo.msg, 'spam')

def test_failure_with_broken_exception_str(self):
interp = interpreters.create()
for raised, expected in [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Fix an uncaught :exc:`MemoryError` in a subinterpreter being silently
ignored by :meth:`concurrent.interpreters.Interpreter.exec` and
:meth:`concurrent.interpreters.Interpreter.call`. It now raises
:exc:`~concurrent.interpreters.ExecutionFailed` like other exceptions.
4 changes: 0 additions & 4 deletions Python/crossinterp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1425,10 +1425,6 @@ _PyXI_excinfo_InitFromException(_PyXI_excinfo *info, PyObject *exc)
{
assert(exc != NULL);

if (PyErr_GivenExceptionMatches(exc, PyExc_MemoryError)) {
_PyXI_excinfo_clear(info);
return NULL;
}
const char *failure = NULL;

if (_excinfo_init_type_from_exception(&info->type, exc) < 0) {
Expand Down
Loading