mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-112729: Correctly fail when the process is out of memory during interpreter creation (GH-139164)
This commit is contained in:
parent
2fd43a1ffe
commit
d06113c7a7
3 changed files with 19 additions and 9 deletions
|
|
@ -7,6 +7,7 @@
|
|||
# Raise SkipTest if subinterpreters not supported.
|
||||
import_helper.import_module('_interpreters')
|
||||
from concurrent import interpreters
|
||||
from concurrent.interpreters import InterpreterError
|
||||
from .utils import TestBase
|
||||
|
||||
|
||||
|
|
@ -74,6 +75,14 @@ def run():
|
|||
start.set()
|
||||
support.gc_collect()
|
||||
|
||||
def test_create_interpreter_no_memory(self):
|
||||
import _interpreters
|
||||
_testcapi = import_helper.import_module("_testcapi")
|
||||
|
||||
with self.assertRaises(InterpreterError):
|
||||
_testcapi.set_nomemory(0, 1)
|
||||
_interpreters.create()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Test needs to be a package, so we can do relative imports.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue