From 3fe87b72c787fdf5d4b735d081f0aaecabb2a2e4 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Tue, 15 Aug 2023 17:56:33 +0900 Subject: [PATCH] gh-107963: Fix set_forkserver_preload to check the type of given list --- Lib/multiprocessing/forkserver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/multiprocessing/forkserver.py b/Lib/multiprocessing/forkserver.py index 22a911a7a29cdc0..8c1a2c610a16c06 100644 --- a/Lib/multiprocessing/forkserver.py +++ b/Lib/multiprocessing/forkserver.py @@ -61,7 +61,7 @@ def _stop_unlocked(self): def set_forkserver_preload(self, modules_names): '''Set list of module names to try to load in forkserver process.''' - if not all(type(mod) is str for mod in self._preload_modules): + if not all(type(mod) is str for mod in module_names): raise TypeError('module_names must be a list of strings') self._preload_modules = modules_names