mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
[3.13] gh-126654: Fix crash in several functions in _interpreters
module (GH-126678) (#126681)
gh-126654: Fix crash in several functions in `_interpreters` module (GH-126678)
(cherry picked from commit 9fc2808eaf
)
Co-authored-by: sobolevn <mail@sobolevn.me>
This commit is contained in:
parent
90cf1af325
commit
e194b21753
3 changed files with 25 additions and 0 deletions
|
@ -551,6 +551,24 @@ class DestroyTests(TestBase):
|
|||
self.assertTrue(_interpreters.is_running(interp))
|
||||
|
||||
|
||||
class CommonTests(TestBase):
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
self.id = _interpreters.create()
|
||||
|
||||
def test_signatures(self):
|
||||
# for method in ['exec', 'run_string', 'run_func']:
|
||||
msg = "expected 'shared' to be a dict"
|
||||
with self.assertRaisesRegex(TypeError, msg):
|
||||
_interpreters.exec(self.id, 'a', 1)
|
||||
with self.assertRaisesRegex(TypeError, msg):
|
||||
_interpreters.exec(self.id, 'a', shared=1)
|
||||
with self.assertRaisesRegex(TypeError, msg):
|
||||
_interpreters.run_string(self.id, 'a', shared=1)
|
||||
with self.assertRaisesRegex(TypeError, msg):
|
||||
_interpreters.run_func(self.id, lambda: None, shared=1)
|
||||
|
||||
|
||||
class RunStringTests(TestBase):
|
||||
|
||||
def setUp(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue