-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure windows wrapper exits after fatal error
- Loading branch information
Showing
4 changed files
with
14 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import logging | ||
# (C) Copyright 2023 TheOtherP ([email protected]) | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
@@ -16,12 +16,20 @@ | |
# Just for pyinstaller | ||
|
||
import sys | ||
import time | ||
|
||
import nzbhydra2wrapperPy3 | ||
import systemTray | ||
|
||
if __name__ == '__main__': | ||
thread = systemTray.start() | ||
nzbhydra2wrapperPy3.quiet = True | ||
nzbhydra2wrapperPy3.main(sys.argv[1:]) | ||
systemTray.stop() | ||
try: | ||
nzbhydra2wrapperPy3.main(sys.argv[1:]) | ||
systemTray.stop() | ||
except SystemExit as e: | ||
logging.getLogger('root').info("Wrapper main thread quit") | ||
# For some reason thread / process is kept alive without sleeping | ||
time.sleep(1) | ||
systemTray.stop() | ||
sys.exit(e.code) |
Git LFS file not shown