Skip to content

Commit 9465700

Browse files
committed
Simplify is_closing_quote
1 parent 60baf5e commit 9465700

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -814,16 +814,14 @@ def process_key_event(self, e: str) -> None:
814814
else:
815815
self.add_normal_character(e)
816816

817-
def is_closing_quote(self, e):
817+
def is_closing_quote(self, e: str) -> bool:
818818
char_count = self._current_line.count(e)
819-
if (
819+
return (
820820
char_count % 2 == 0
821821
and cursor_on_closing_char_pair(
822822
self._cursor_offset, self._current_line, e
823823
)[0]
824-
):
825-
return True
826-
return False
824+
)
827825

828826
def insert_char_pair_start(self, e):
829827
"""Accepts character which is a part of CHARACTER_PAIR_MAP

0 commit comments

Comments
 (0)