doublex · GitHub

The param sys_path is ignored. Result: ModuleNotFoundError for preloaded modules.

a) Using sys_path fixes this issue
b) Maybe better remove "pass" and report and error to simplify problem solving

    if preload:
        if '__main__' in preload and main_path is not None:
            process.current_process()._inheriting = True
            try:
                spawn.import_main_path(main_path)
            finally:
                del process.current_process()._inheriting
+        if sys_path:
+            sys.path = sys_path
        for modname in preload:
            try:
                __import__(modname)
            except ImportError:
-                pass
+                warnings.warn('forkserver: preloading module failed %s' % modname)

Read the original on github.com ↗