| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e2420c5 commit db4400b
3 files changed
| 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 | |
|---|---|---|---|
@@ -5293,6 +5293,14 @@ def test_context(self): | |||
| 5293 | 5293 | self.assertRaises(ValueError, ctx.set_start_method, None) | |
| 5294 | 5294 | self.check_context(ctx) | |
| 5295 | 5295 | ||
| 5296 | + def test_context_check_module_types(self): | ||
| 5297 | + try: | ||
| 5298 | + ctx = multiprocessing.get_context('forkserver') | ||
| 5299 | + except ValueError: | ||
| 5300 | + raise unittest.SkipTest('forkserver should be available') | ||
| 5301 | + with self.assertRaisesRegex(TypeError, 'module_names must be a list of strings'): | ||
| 5302 | + ctx.set_forkserver_preload([1, 2, 3]) | ||
| 5303 | + | ||
| 5296 | 5304 | def test_set_get(self): | |
| 5297 | 5305 | multiprocessing.set_forkserver_preload(PRELOAD) | |
| 5298 | 5306 | 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