Skip to content

Commit dd04f4b

Browse files
committed
fix check_not_importing_main error on mac
1 parent 3ee651d commit dd04f4b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

py/genlast.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ def maybe_preprocess(fn):
5959
if subprocess.call(["grep", "-lqE", "(MP_QSTR|translate)", fn]) == 0:
6060
preprocess(fn)
6161

62+
# Documentation states that this has something to do with frozen programs
63+
# on Windows and that the line "can be omitted if the program is not going to
64+
# be frozen to produce an executable". However, this exception is actually
65+
# occurring on Mac mpy-cross builds without this line. Attempt to correct
66+
# the problem.
67+
multiprocessing.freeze_support()
68+
6269
executor = ProcessPoolExecutor(max_workers=multiprocessing.cpu_count() + 1)
6370
executor.map(maybe_preprocess, check)
6471
executor.map(preprocess, always)

0 commit comments

Comments
 (0)