Skip to content

Commit 0ee753a

Browse files
fix crash due to calling last_word on a line with only whitespace
1 parent b51663c commit 0ee753a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,7 @@ def tabs_to_spaces(line):
15201520

15211521

15221522
def _last_word(line):
1523-
return line.split().pop() if line else ''
1523+
return line.split().pop() if line.split() else ''
15241524

15251525

15261526
def compress_paste_event(paste_event):

0 commit comments

Comments
 (0)