summaryrefslogtreecommitdiffhomepage
path: root/bazarr.py
diff options
context:
space:
mode:
authorLouis Vézina <[email protected]>2020-05-18 08:56:16 -0400
committerLouis Vézina <[email protected]>2020-05-18 08:56:16 -0400
commit0fb4160407aca76fbe3688da8ccce140917ae87e (patch)
tree50fd4db7cbabbb73cbcdd2d3d9513474b4e2a961 /bazarr.py
parent7e0c298dd7d1b2bcf0d720c0554fa3cdaf8a02d0 (diff)
downloadbazarr-0fb4160407aca76fbe3688da8ccce140917ae87e.tar.gz
bazarr-0fb4160407aca76fbe3688da8ccce140917ae87e.zip
WIP
Diffstat (limited to 'bazarr.py')
-rw-r--r--bazarr.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/bazarr.py b/bazarr.py
index f9e5d1c3f..51846124b 100644
--- a/bazarr.py
+++ b/bazarr.py
@@ -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)