| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,7 +61,7 @@ def _stop_unlocked(self): | |||
| 61 | 61 | ||
| 62 | 62 | def set_forkserver_preload(self, modules_names): | |
| 63 | 63 | '''Set list of module names to try to load in forkserver process.''' | |
| 64 | - if not all(type(mod) is str for mod in self._preload_modules): | ||
| 64 | + if not all(type(mod) is str for mod in modules_names): | ||
| 65 | 65 | raise TypeError('module_names must be a list of strings') | |
| 66 | 66 | self._preload_modules = modules_names | |
| 67 | 67 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5369,6 +5369,14 @@ def test_context(self): | |||
| 5369 | 5369 | self.assertRaises(ValueError, ctx.set_start_method, None) | |
| 5370 | 5370 | self.check_context(ctx) | |
| 5371 | 5371 | ||
| 5372 | + def test_context_check_module_types(self): | ||
| 5373 | + try: | ||
| 5374 | + ctx = multiprocessing.get_context('forkserver') | ||
| 5375 | + except ValueError: | ||
| 5376 | + raise unittest.SkipTest("forkserver should be available") | ||
| 5377 | + with self.assertRaisesRegex(TypeError, 'module_names must be a list of strings'): | ||
| 5378 | + ctx.set_forkserver_preload([1, 2, 3]) | ||
| 5379 | + | ||
| 5372 | 5380 | def test_set_get(self): | |
| 5373 | 5381 | multiprocessing.set_forkserver_preload(PRELOAD) | |
| 5374 | 5382 | count = 0 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,2 @@ | |||
| 1 | + Fix :func:`multiprocessing.set_forkserver_preload` to check the given list | ||
| 2 | + of modules names. Patch by Dong-hee Na. | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments