diff options
-rwxr-xr-x | cmd2/cmd2.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 40466446..c8b3a9db 100755 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -2959,14 +2959,11 @@ class Cmd(cmd.Cmd): choice = int(response) if choice < 1: raise IndexError - result = fulloptions[choice - 1][0] - break + return fulloptions[choice - 1][0] except (ValueError, IndexError): self.poutput("{!r} isn't a valid choice. Pick a number between 1 and {}:".format( response, len(fulloptions))) - return result - def _get_read_only_settings(self) -> str: """Return a summary report of read-only settings which the user cannot modify at runtime. |