diff options
author | Louis Vézina <[email protected]> | 2020-05-18 08:56:16 -0400 |
---|---|---|
committer | Louis Vézina <[email protected]> | 2020-05-18 08:56:16 -0400 |
commit | 0fb4160407aca76fbe3688da8ccce140917ae87e (patch) | |
tree | 50fd4db7cbabbb73cbcdd2d3d9513474b4e2a961 | |
parent | 7e0c298dd7d1b2bcf0d720c0554fa3cdaf8a02d0 (diff) | |
download | bazarr-0fb4160407aca76fbe3688da8ccce140917ae87e.tar.gz bazarr-0fb4160407aca76fbe3688da8ccce140917ae87e.zip |
WIP
-rw-r--r-- | bazarr.py | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -31,10 +31,17 @@ check_python_version() dir_name = os.path.dirname(__file__) +def end_child_process(ep): + try: + ep.kill() + except: + pass + + def start_bazarr(): script = [sys.executable, "-u", os.path.normcase(os.path.join(dir_name, 'bazarr', 'main.py'))] + sys.argv[1:] ep = subprocess.Popen(script, stdout=None, stderr=None, stdin=subprocess.DEVNULL) - atexit.register(lambda: ep.kill()) + atexit.register(end_child_process, ep=ep) def check_status(): @@ -85,4 +92,5 @@ if __name__ == '__main__': else: os.wait() except (KeyboardInterrupt, SystemExit): - pass + print('Bazarr exited.') + sys.exit(0) |