Skip to content

Commit 30f8dba

Browse files
committed
Check for None
1 parent 9465700 commit 30f8dba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bpython/line.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,13 @@ def cursor_on_closing_char_pair(cursor_offset, line, ch=None):
300300
if cursor_offset < len(line):
301301
cur_char = line[cursor_offset]
302302
if cur_char in CHARACTER_PAIR_MAP.values():
303-
on_closing_char = True if not ch else cur_char == ch
303+
on_closing_char = True if ch is None else cur_char == ch
304304
if cursor_offset > 0:
305305
prev_char = line[cursor_offset - 1]
306306
if (
307307
on_closing_char
308308
and prev_char in CHARACTER_PAIR_MAP
309309
and CHARACTER_PAIR_MAP[prev_char] == cur_char
310310
):
311-
pair_close = True if not ch else prev_char == ch
311+
pair_close = True if ch is None else prev_char == ch
312312
return on_closing_char, pair_close

0 commit comments

Comments
 (0)