Skip to content

Commit

Permalink
Fix shell exit on expected errors
Browse files Browse the repository at this point in the history
  • Loading branch information
martinhoyer committed May 15, 2024
1 parent 6a7f22f commit cacba98
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/targetcli/targetcli_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,11 @@ def main():
if not is_root:
shell.con.display("You are not root, disabling privileged commands.\n")

try:
while not shell._exit:
while not shell._exit:
try:
shell.run_interactive()
except (RTSLibError, ExecutionError) as msg:
shell.log.error(str(msg))
except (RTSLibError, ExecutionError) as msg: # noqa: PERF203 - would otherwise exit shell
shell.log.error(str(msg))

if shell.prefs['auto_save_on_exit'] and is_root:
shell.log.info("Global pref auto_save_on_exit=true")
Expand Down

0 comments on commit cacba98

Please sign in to comment.