From f401702e7cd21fe219f84561d3ce8a2fe2488f1a Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Wed, 17 May 2023 15:27:29 +0200 Subject: [PATCH] Core: skip ModuleUpdate in subprocess --- ModuleUpdate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ModuleUpdate.py b/ModuleUpdate.py index ac40dbd66be1..209f2da67253 100644 --- a/ModuleUpdate.py +++ b/ModuleUpdate.py @@ -1,6 +1,7 @@ import os import sys import subprocess +import multiprocessing import warnings local_dir = os.path.dirname(__file__) @@ -9,7 +10,8 @@ if sys.version_info < (3, 8, 6): raise RuntimeError("Incompatible Python Version. 3.8.7+ is supported.") -update_ran = getattr(sys, "frozen", False) # don't run update if environment is frozen/compiled +# don't run update if environment is frozen/compiled or if not the parent process (skip in subprocess) +update_ran = getattr(sys, "frozen", False) or multiprocessing.parent_process() if not update_ran: for entry in os.scandir(os.path.join(local_dir, "worlds")):