summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin George Roberts <benjamin@bgroberts.id.au>2021-10-25 10:38:53 +1100
committerKevin Van Brunt <kmvanbrunt@gmail.com>2021-10-25 16:36:02 -0400
commit4fac4902e4c54e441379644826a355c2837bde1b (patch)
tree064d49c7e98143970b617a1ac3086e6f08a27d5e
parent369cd7a07b5d6c17e762184f54de05e9965a6171 (diff)
downloadcmd2-git-4fac4902e4c54e441379644826a355c2837bde1b.tar.gz
Fixed regression in Cmd.select converting "Any" type argument to string
-rw-r--r--cmd2/cmd2.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index c06b9617..09b3fe43 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -3865,7 +3865,7 @@ class Cmd(cmd.Cmd):
self.last_result = True
return True
- def select(self, opts: Union[str, List[str], List[Tuple[Any, Optional[str]]]], prompt: str = 'Your choice? ') -> str:
+ def select(self, opts: Union[str, List[str], List[Tuple[Any, Optional[str]]]], prompt: str = 'Your choice? ') -> Any:
"""Presents a numbered menu to the user. Modeled after
the bash shell's SELECT. Returns the item chosen.
@@ -3910,7 +3910,7 @@ class Cmd(cmd.Cmd):
choice = int(response)
if choice < 1:
raise IndexError
- return str(fulloptions[choice - 1][0])
+ return fulloptions[choice - 1][0]
except (ValueError, IndexError):
self.poutput(f"'{response}' isn't a valid choice. Pick a number between 1 and {len(fulloptions)}:")