Skip to content

Commit ea5c242

Browse files
committed
Fixed unbound local warning
1 parent c66d028 commit ea5c242

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,9 +1836,6 @@ def _pad_matches_to_display(matches_to_display):
18361836
:param matches_to_display: the matches being padded
18371837
:return: the padded matches and length of padding that was added
18381838
"""
1839-
if rl_type == RlType.NONE:
1840-
return matches_to_display, 0
1841-
18421839
if rl_type == RlType.GNU:
18431840
# Add 2 to the padding of 2 that readline uses for a total of 4.
18441841
padding = 2 * ' '
@@ -1847,6 +1844,9 @@ def _pad_matches_to_display(matches_to_display):
18471844
# Add 3 to the padding of 1 that pyreadline uses for a total of 4.
18481845
padding = 3 * ' '
18491846

1847+
else:
1848+
return matches_to_display, 0
1849+
18501850
return [cur_match + padding for cur_match in matches_to_display], len(padding)
18511851

18521852
def _display_matches_gnu_readline(self, substitution, matches, longest_match_length):

0 commit comments

Comments
 (0)