Save REPL history after an exception

This commit is contained in:
Kodi Arfer 2017-07-26 14:22:50 -07:00
parent 0a14410911
commit 2f340f8049
2 changed files with 7 additions and 4 deletions

2
NEWS
View File

@ -20,6 +20,8 @@ Changes from 0.13.0
* String literals should no longer be interpreted as special forms or macros
* Tag macros (née sharp macros) whose names begin with `!` are no longer
mistaken for shebang lines
* Fixed a bug where REPL history wasn't saved if you quit the REPL with
`(quit)` or `(exit)`
Changes from 0.12.1

View File

@ -124,7 +124,8 @@ def completion(completer=None):
readline.parse_and_bind(readline_bind)
yield
if docomplete:
readline.write_history_file(history)
try:
yield
finally:
if docomplete:
readline.write_history_file(history)