Skip to content

Commit

Permalink
Core: skip ModuleUpdate in subprocess
Browse files Browse the repository at this point in the history
  • Loading branch information
Berserker66 committed May 18, 2023
1 parent 68bfe17 commit f401702
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ModuleUpdate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import sys
import subprocess
import multiprocessing
import warnings

local_dir = os.path.dirname(__file__)
Expand All @@ -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")):
Expand Down

0 comments on commit f401702

Please sign in to comment.