diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-12-13 21:55:22 -0500 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-12-13 21:55:22 -0500 |
commit | 526217dc99e9d9122598f684c594e7625532b59f (patch) | |
tree | d906d3d16e7cb82747611aadff359c2aeb4114a4 /cmd2 | |
parent | 3efb3f14630d007572a5cf1246bdb78ee63be089 (diff) | |
download | cmd2-git-526217dc99e9d9122598f684c594e7625532b59f.tar.gz |
Fixed bug in cmd2.Cmd.select() when user enters 0 or negative number
Diffstat (limited to 'cmd2')
-rw-r--r-- | cmd2/cmd2.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index a513d0e7..56d74ec8 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -2780,6 +2780,8 @@ class Cmd(cmd.Cmd): try: choice = int(response) + if choice < 1: + raise IndexError result = fulloptions[choice - 1][0] break except (ValueError, IndexError): |