Skip to content

Commit c8257df

Browse files
authored
Dont wait for child process to exit (#155)
1 parent 0a3da12 commit c8257df

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/sinol_make/util.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import shutil
66
import hashlib
77
import subprocess
8-
import threading
8+
import multiprocessing
99
import resource
1010
from typing import Union
1111

@@ -140,8 +140,9 @@ def check_for_updates(current_version) -> Union[str, None]:
140140
os.mkdir(data_dir)
141141

142142
# We check for new version asynchronously, so that it doesn't slow down the program.
143-
thread = threading.Thread(target=check_version)
144-
thread.start()
143+
# If the main process exits, the check_version process will also exit.
144+
process = multiprocessing.Process(target=check_version, daemon=True)
145+
process.start()
145146
version_file = data_dir.joinpath("version")
146147

147148
try:

0 commit comments

Comments
 (0)