mirror of
https://github.com/kk7ds/chirp
synced 2026-08-13 17:51:36 -04:00
chirpc: Fix exit code on successful --download-mmap and --upload-mmap
sys.exit(1) was called unconditionally after the try/except block in both the download and upload paths, returning failure even when the operation succeeded. Move sys.exit(1) inside the except block and add sys.exit(0) on success.
This commit is contained in:
parent
68546632f7
commit
cde8745c34
1 changed files with 5 additions and 2 deletions
|
|
@ -379,9 +379,11 @@ def main(args=None):
|
|||
try:
|
||||
radio.sync_in()
|
||||
radio.save_mmap(options.mmap)
|
||||
LOG.info("Download successful: %s", options.mmap)
|
||||
sys.exit(0)
|
||||
except Exception as e:
|
||||
LOG.exception(e)
|
||||
sys.exit(1)
|
||||
sys.exit(1)
|
||||
|
||||
if options.upload_mmap:
|
||||
if not issubclass(rclass, chirp_common.CloneModeRadio):
|
||||
|
|
@ -394,9 +396,10 @@ def main(args=None):
|
|||
radio.load_mmap(options.mmap)
|
||||
radio.sync_out()
|
||||
print("Upload successful")
|
||||
sys.exit(0)
|
||||
except Exception as e:
|
||||
LOG.exception(e)
|
||||
sys.exit(1)
|
||||
sys.exit(1)
|
||||
|
||||
if options.mmap and isinstance(radio, chirp_common.CloneModeRadio):
|
||||
radio.save_mmap(options.mmap)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue