Skip to content

Commit 10992f0

Browse files
lvgelderthomasballinger
authored andcommitted
fix #432 bpython-curtsies crashes if no readline history on enter
It actually works correctly if there is no existing history the first time you press enter. But then insert_into_history sets entries to [] and tries to read from the history file, which will do nothing if the history file is empty. History should be fixed properly on master, but for now just fixing the call which shouldn't have been rl_history.last() in the first place.
1 parent 5342649 commit 10992f0

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
@@ -371,7 +371,7 @@ def on_enter(self, insert_into_history=True):
371371
self.highlighted_paren = None
372372

373373
self.rl_history.append(self._current_line)
374-
self.rl_history.last()
374+
self.rl_history.reset()
375375
self.history.append(self._current_line)
376376
line = self._current_line
377377
#self._current_line = ''

0 commit comments

Comments
 (0)