Skip to content

Commit

Permalink
Bug fix when catching exception of sys.exit/exit
Browse files Browse the repository at this point in the history
--version and --help exited with code error 1
  • Loading branch information
lfpaulin committed Apr 10, 2024
1 parent e79ac1c commit 034d8a9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = sniffles
version = 2.3.1
version = 2.3.2
author = Moritz Smolka, Hermann Romanek
author_email = moritz.g.smolka@gmail.com, sniffles@romanek.at
description = A fast structural variation caller for long-read sequencing data
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='sniffles',
version='2.3.1',
version='2.3.2',
packages=find_packages(),
url='https://github.com/fritzsedlazeck/Sniffles',
license='MIT',
Expand Down
2 changes: 1 addition & 1 deletion src/sniffles/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from sniffles import util

VERSION = "Sniffles2"
BUILD = "2.3.1"
BUILD = "2.3.2"
SNF_VERSION = "S2_rc4"


Expand Down
10 changes: 5 additions & 5 deletions src/sniffles/sniffles
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ from typing import Optional

from sniffles.utils.resmon import ResourceMonitor

DEV_MONITOR_MEM = False

import sys

if not sys.version_info >= (3, 10):
Expand All @@ -35,7 +33,7 @@ from sniffles import parallel
from sniffles import util

# TODO: Dev/Debugging only - Remove for prod
DEV_MONITOR_MEM = True
DEV_MONITOR_MEM = False

if DEV_MONITOR_MEM:
try:
Expand Down Expand Up @@ -511,7 +509,8 @@ if __name__ == "__main__":

try:
Sniffles2_Main(processes)
except (util.Sniffles2Exit, SystemExit):
except (util.Sniffles2Exit, SystemExit) as exit_code:
# print(f'Sniffles exit with code {exit_code}')
if len(processes):
# Allow time for child process error messages to propagate
print("Sniffles2Main: Shutting down workers")
Expand All @@ -527,6 +526,7 @@ if __name__ == "__main__":
proc.process.join()
except:
pass
exit(1)
int_exit_code = exit_code.args[0]
exit(int_exit_code)
except:
logging.getLogger('sniffles.main').exception(f'Unhandled error while running sniffles.')

0 comments on commit 034d8a9

Please sign in to comment.