Skip to content

Commit a832ea3

Browse files
Ben-Regsebastinas
authored andcommitted
Found and fixed the mock error, still need to address the matches_iter error
1 parent 1745ad5 commit a832ea3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bpython/cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
Tuple,
6969
Collection,
7070
Dict,
71+
Literal,
7172
)
7273
import unicodedata
7374
from dataclasses import dataclass
@@ -1330,7 +1331,7 @@ def show_list(
13301331
arg_pos: Union[str, int, None],
13311332
topline: Any = None, # Named tuples don't play nice with mypy
13321333
formatter: Optional[Callable] = None,
1333-
current_item: Optional[str] = None,
1334+
current_item: Union[str, Literal[False]] = None,
13341335
) -> None:
13351336
v_items: Collection
13361337
shared = ShowListState()
@@ -1527,9 +1528,8 @@ def tab(self, back: bool = False) -> bool:
15271528

15281529
# 4. swap current word for a match list item
15291530
elif self.matches_iter.matches:
1530-
n: str = next(self.matches_iter)
1531-
current_match: Optional[str] = (
1532-
back and self.matches_iter.previous() or n
1531+
current_match: Union[str, Literal[False]] = (
1532+
back and self.matches_iter.previous() or next(self.matches_iter)
15331533
)
15341534
try:
15351535
self.show_list(

0 commit comments

Comments
 (0)