def METHOD_NAME(self):
    # Issue #30696: Fix the interactive interpreter looping endlessly when
    # no memory. Check also that the fix does not break the interactive
    # loop when an exception is raised.
    user_input = """
        import sys, _testcapi
        1/0
        print('After the exception.')
        _testcapi.set_nomemory(0)
        sys.exit(0)
    """
    user_input = dedent(user_input)
    p = spawn_repl()
    with SuppressCrashReport():
        p.stdin.write(user_input)
    output = kill_python(p)
    self.assertIn('After the exception.', output)
    # Exit code 120: Py_FinalizeEx() failed to flush stdout and stderr.
    self.assertIn(p.returncode, (1, 120))