Skip to content

Commit

Permalink
skips opening a subprocess if kivy (and thus the launcher gui) hasn't…
Browse files Browse the repository at this point in the history
… been loaded so stdin can function as expected on --nogui and similar
  • Loading branch information
qwint committed Nov 24, 2024
1 parent 03b90cf commit a70d177
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions worlds/LauncherComponents.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@ def __repr__(self):


def launch_subprocess(func: Callable, name: str = None, args: Tuple[str, ...] = ()) -> None:
global processes
import multiprocessing
process = multiprocessing.Process(target=func, name=name, args=args)
process.start()
processes.add(process)
import sys
if "kivy" not in sys.modules:
func(*args)
else:
global processes
import multiprocessing
process = multiprocessing.Process(target=func, name=name, args=args)
process.start()
processes.add(process)


class SuffixIdentifier:
Expand Down

0 comments on commit a70d177

Please sign in to comment.