Skip to content

Commit 0c40b67

Browse files
committed
Refactor
1 parent 167fc26 commit 0c40b67

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

bpython/autocomplete.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -715,17 +715,15 @@ def matches(
715715
) -> Optional[Set]:
716716
if current_block is None or history is None:
717717
return None
718-
719-
if "\n" in current_block:
720-
assert cursor_offset <= len(line), "{!r} {!r}".format(
721-
cursor_offset,
722-
line,
723-
)
724-
results = super().matches(cursor_offset, line, history=history)
725-
return results
726-
else:
718+
if "\n" not in current_block:
727719
return None
728720

721+
assert cursor_offset <= len(line), "{!r} {!r}".format(
722+
cursor_offset,
723+
line,
724+
)
725+
return super().matches(cursor_offset, line, history=history)
726+
729727

730728
def get_completer(
731729
completers: Sequence[BaseCompletionType],

0 commit comments

Comments
 (0)