diff options
| author | Eric Snow <ericsnowcurrently@gmail.com> | 2024-04-03 16:58:39 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-03 16:58:39 (GMT) |
| commit | 976bcb2379709da57073a9e07b518ff51daa617a (patch) | |
| tree | 66fca9084cbae6c0b503491f627829d703df19bc /Lib/test/test_interpreters/test_api.py | |
| parent | 7ecd55d604a8fa287c1d131cac14d10260be826b (diff) | |
| download | cpython-976bcb2379709da57073a9e07b518ff51daa617a.zip cpython-976bcb2379709da57073a9e07b518ff51daa617a.tar.gz cpython-976bcb2379709da57073a9e07b518ff51daa617a.tar.bz2 | |
gh-76785: Raise InterpreterError, Not RuntimeError (gh-117489)
I had meant to switch everything to InterpreterError when I added it a while back. At the time I missed a few key spots.
As part of this, I've added print-the-exception to _PyXI_InitTypes() and fixed an error case in `_PyStaticType_InitBuiltin().
Diffstat (limited to 'Lib/test/test_interpreters/test_api.py')
| -rw-r--r-- | Lib/test/test_interpreters/test_api.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_interpreters/test_api.py b/Lib/test/test_interpreters/test_api.py index 2aa7f9b..a326b39 100644 --- a/Lib/test/test_interpreters/test_api.py +++ b/Lib/test/test_interpreters/test_api.py @@ -364,11 +364,11 @@ class TestInterpreterClose(TestBase): def test_main(self): main, = interpreters.list_all() - with self.assertRaises(RuntimeError): + with self.assertRaises(interpreters.InterpreterError): main.close() def f(): - with self.assertRaises(RuntimeError): + with self.assertRaises(interpreters.InterpreterError): main.close() t = threading.Thread(target=f) @@ -389,7 +389,7 @@ class TestInterpreterClose(TestBase): interp = interpreters.Interpreter({interp.id}) try: interp.close() - except RuntimeError: + except interpreters.InterpreterError: print('failed') """)) self.assertEqual(out.strip(), 'failed') @@ -424,7 +424,7 @@ class TestInterpreterClose(TestBase): main, = interpreters.list_all() interp = interpreters.create() with _running(interp): - with self.assertRaises(RuntimeError): + with self.assertRaises(interpreters.InterpreterError): interp.close() self.assertTrue(interp.is_running()) @@ -1103,7 +1103,7 @@ class LowLevelTests(TestBase): self.assert_ns_equal(config, default) with self.subTest('arg: \'empty\''): - with self.assertRaises(RuntimeError): + with self.assertRaises(interpreters.InterpreterError): # The "empty" config isn't viable on its own. _interpreters.create('empty') |
