diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-04-13 00:57:48 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-04-13 00:57:48 -0400 |
commit | ea5c242ae06b3f31644cc0c62db8157249c6ef6a (patch) | |
tree | 07ce95ddbea24af91fba154f42c2fd7bf086678c /cmd2.py | |
parent | c66d02852baf91d04b568b709db70a10487203f0 (diff) | |
download | cmd2-git-ea5c242ae06b3f31644cc0c62db8157249c6ef6a.tar.gz |
Fixed unbound local warning
Diffstat (limited to 'cmd2.py')
-rwxr-xr-x | cmd2.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1836,9 +1836,6 @@ class Cmd(cmd.Cmd): :param matches_to_display: the matches being padded :return: the padded matches and length of padding that was added """ - if rl_type == RlType.NONE: - return matches_to_display, 0 - if rl_type == RlType.GNU: # Add 2 to the padding of 2 that readline uses for a total of 4. padding = 2 * ' ' @@ -1847,6 +1844,9 @@ class Cmd(cmd.Cmd): # Add 3 to the padding of 1 that pyreadline uses for a total of 4. padding = 3 * ' ' + else: + return matches_to_display, 0 + return [cur_match + padding for cur_match in matches_to_display], len(padding) def _display_matches_gnu_readline(self, substitution, matches, longest_match_length): |