Skip to content

Commit 6f4b3c2

Browse files
Ben-Regsebastinas
authored andcommitted
Fixed pytest errors
1 parent a832ea3 commit 6f4b3c2

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

bpython/cli.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -514,12 +514,12 @@ def complete(self, tab: bool = False) -> None:
514514

515515
list_win_visible = repl.Repl.complete(self, tab)
516516

517-
f = None
518-
if self.matches_iter.completer:
519-
f = self.matches_iter.completer.format
520-
521517
if list_win_visible:
522518
try:
519+
f = None
520+
if self.matches_iter.completer:
521+
f = self.matches_iter.completer.format
522+
523523
self.show_list(
524524
self.matches_iter.matches,
525525
self.arg_pos,
@@ -1494,10 +1494,6 @@ def tab(self, back: bool = False) -> bool:
14941494
and don't indent if there are only whitespace in the line.
14951495
"""
14961496

1497-
f = None
1498-
if self.matches_iter.completer:
1499-
f = self.matches_iter.completer.format
1500-
15011497
# 1. check if we should add a tab character
15021498
if self.atbol() and not back:
15031499
x_pos = len(self.s) - self.cpos
@@ -1532,6 +1528,10 @@ def tab(self, back: bool = False) -> bool:
15321528
back and self.matches_iter.previous() or next(self.matches_iter)
15331529
)
15341530
try:
1531+
f = None
1532+
if self.matches_iter.completer:
1533+
f = self.matches_iter.completer.format
1534+
15351535
self.show_list(
15361536
self.matches_iter.matches,
15371537
self.arg_pos,

bpython/repl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ class Repl:
423423
"""
424424

425425
if TYPE_CHECKING:
426+
426427
@property
427428
@abstractmethod
428429
def current_line(self):

0 commit comments

Comments
 (0)