File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1245,6 +1245,14 @@ Miscellaneous
12451245 For this to work, it must be called before the forkserver process has been
12461246 launched (before creating a :class: `Pool ` or starting a :class: `Process `).
12471247
1248+ Only modules directly imported at top level by *module_names * are preloaded.
1249+ If a preloaded module lazily imports dependencies inside functions or methods
1250+ (for example, :meth: `datetime.datetime.strptime ` importing ``_strptime `` on
1251+ its first invocation), those dependencies are not loaded into the forkserver
1252+ process and will instead be imported separately in each child process upon
1253+ first use. To inherit those as well, call such functions at module level
1254+ within a preloaded module.
1255+
12481256 The *on_error * parameter controls how :exc: `ImportError ` exceptions during
12491257 module preloading are handled: ``"ignore" `` (default) silently ignores
12501258 failures, ``"warn" `` causes the forkserver subprocess to emit an
You can’t perform that action at this time.
0 commit comments