Skip to content

Commit d4fc2cd

Browse files
committed
massive hack to stop bpython crashing if the suggestions popup window makes bad
curses calls (e.g. tries to write outside the bounds of the window/screen). It's not nice, but at least it stops the program from dying.
1 parent 492f168 commit d4fc2cd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bpython/cli.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,12 @@ def _complete(self, tab=False):
740740
self.tab()
741741
return False
742742

743-
self.show_list(self.matches, self.argspec)
743+
try:
744+
self.show_list(self.matches, self.argspec)
745+
except curses.error:
746+
# XXX: This is a massive hack, it will go away when I get
747+
# cusswords into a good enough state that we can start using it.
748+
return False
744749
return True
745750

746751
def show_list(self, items, topline=None):

0 commit comments

Comments
 (0)