From 3e850ddd43593cb74e9b623742f708edee6b41c5 Mon Sep 17 00:00:00 2001 From: MasloMaslane Date: Sat, 28 Oct 2023 13:32:42 +0200 Subject: [PATCH] Dont wait for child process to exit --- src/sinol_make/util.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sinol_make/util.py b/src/sinol_make/util.py index a7a38511..62650d2b 100644 --- a/src/sinol_make/util.py +++ b/src/sinol_make/util.py @@ -5,7 +5,7 @@ import shutil import hashlib import subprocess -import threading +import multiprocessing import resource from typing import Union @@ -140,8 +140,9 @@ def check_for_updates(current_version) -> Union[str, None]: os.mkdir(data_dir) # We check for new version asynchronously, so that it doesn't slow down the program. - thread = threading.Thread(target=check_version) - thread.start() + # If the main process exits, the check_version process will also exit. + process = multiprocessing.Process(target=check_version, daemon=True) + process.start() version_file = data_dir.joinpath("version") try: