From b8c01a6db6a38a7af88eb0630f2584acb1f3c357 Mon Sep 17 00:00:00 2001 From: Yuxin Wu Date: Thu, 23 Feb 2023 22:23:31 -0800 Subject: [PATCH] More actionable error message when spawn is incorrectly used. --- Lib/multiprocessing/spawn.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/multiprocessing/spawn.py b/Lib/multiprocessing/spawn.py index 09f8a229d7cccb..b0f1b1764a6145 100644 --- a/Lib/multiprocessing/spawn.py +++ b/Lib/multiprocessing/spawn.py @@ -148,7 +148,11 @@ def _check_not_importing_main(): ... The "freeze_support()" line can be omitted if the program - is not going to be frozen to produce an executable.''') + is not going to be frozen to produce an executable. + + To fix this issue, refer to the "Safe importing of main module" + section in https://docs.python.org/3/library/multiprocessing.html + ''') def get_preparation_data(name):