mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
[3.11] gh-107963: Fix set_forkserver_preload to check the type of given list (GH-107965) (gh-107976)
gh-107963: Fix set_forkserver_preload to check the type of given list (GH-107965)
(cherry picked from commit 6515ec3d3d
)
gh-107963: Fix set_forkserver_preload to check the type of given list
Co-authored-by: Dong-hee Na <donghee.na@python.org>
This commit is contained in:
parent
e2420c5cae
commit
db4400b5b2
3 changed files with 11 additions and 1 deletions
|
@ -5293,6 +5293,14 @@ class TestStartMethod(unittest.TestCase):
|
|||
self.assertRaises(ValueError, ctx.set_start_method, None)
|
||||
self.check_context(ctx)
|
||||
|
||||
def test_context_check_module_types(self):
|
||||
try:
|
||||
ctx = multiprocessing.get_context('forkserver')
|
||||
except ValueError:
|
||||
raise unittest.SkipTest('forkserver should be available')
|
||||
with self.assertRaisesRegex(TypeError, 'module_names must be a list of strings'):
|
||||
ctx.set_forkserver_preload([1, 2, 3])
|
||||
|
||||
def test_set_get(self):
|
||||
multiprocessing.set_forkserver_preload(PRELOAD)
|
||||
count = 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue