Skip to content

Commit 4fac490

Browse files
tsujaminkmvanbrunt
authored andcommitted
Fixed regression in Cmd.select converting "Any" type argument to string
1 parent 369cd7a commit 4fac490

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd2/cmd2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3865,7 +3865,7 @@ def do_quit(self, _: argparse.Namespace) -> Optional[bool]:
38653865
self.last_result = True
38663866
return True
38673867

3868-
def select(self, opts: Union[str, List[str], List[Tuple[Any, Optional[str]]]], prompt: str = 'Your choice? ') -> str:
3868+
def select(self, opts: Union[str, List[str], List[Tuple[Any, Optional[str]]]], prompt: str = 'Your choice? ') -> Any:
38693869
"""Presents a numbered menu to the user. Modeled after
38703870
the bash shell's SELECT. Returns the item chosen.
38713871
@@ -3910,7 +3910,7 @@ def select(self, opts: Union[str, List[str], List[Tuple[Any, Optional[str]]]], p
39103910
choice = int(response)
39113911
if choice < 1:
39123912
raise IndexError
3913-
return str(fulloptions[choice - 1][0])
3913+
return fulloptions[choice - 1][0]
39143914
except (ValueError, IndexError):
39153915
self.poutput(f"'{response}' isn't a valid choice. Pick a number between 1 and {len(fulloptions)}:")
39163916

0 commit comments

Comments
 (0)