mirror of
https://github.com/romanz/amodem.git
synced 2026-04-21 05:36:42 +08:00
__main__: implicit exit code handling
This commit is contained in:
@@ -219,12 +219,9 @@ def _main():
|
|||||||
args.dst = args.output_type(args.output)
|
args.dst = args.output_type(args.output)
|
||||||
try:
|
try:
|
||||||
if args.calibrate is False:
|
if args.calibrate is False:
|
||||||
return args.main(config=config, args=args)
|
args.main(config=config, args=args)
|
||||||
else:
|
else:
|
||||||
try:
|
args.calib(config=config, args=args)
|
||||||
args.calib(config=config, args=args)
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
pass
|
|
||||||
finally:
|
finally:
|
||||||
log.debug('Closing input and output')
|
log.debug('Closing input and output')
|
||||||
args.src.close()
|
args.src.close()
|
||||||
@@ -232,5 +229,4 @@ def _main():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
success = _main()
|
_main()
|
||||||
sys.exit(0 if success else 1)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user