diff --git a/src/targetcli/targetcli_shell.py b/src/targetcli/targetcli_shell.py index 2d2bd7d..bd1a8f8 100644 --- a/src/targetcli/targetcli_shell.py +++ b/src/targetcli/targetcli_shell.py @@ -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")