minor cleanup

This commit is contained in:
hroff-1902 2019-03-22 23:41:48 +03:00
parent b448890210
commit e35daf95c0

View File

@ -36,6 +36,7 @@ def main(sysargv: List[str]) -> None:
args.func(args) args.func(args)
return return
worker = None
return_code = 1 return_code = 1
try: try:
# Load and run worker # Load and run worker
@ -51,7 +52,7 @@ def main(sysargv: List[str]) -> None:
except BaseException: except BaseException:
logger.exception('Fatal exception!') logger.exception('Fatal exception!')
finally: finally:
if worker is not None: if worker:
worker.exit() worker.exit()
sys.exit(return_code) sys.exit(return_code)