Merge pull request #1813 from Kodiologist/homeless
Avoid a crash when we can't access a history file
This commit is contained in:
commit
1b8b1f110a
1
NEWS.rst
1
NEWS.rst
@ -27,6 +27,7 @@ Bug Fixes
|
||||
* Statements in the second argument of `assert` are now executed.
|
||||
* Fixed the expression of a while loop that contains statements being compiled twice.
|
||||
* `hy2py` can now handle format strings.
|
||||
* Fixed crashes from inaccessible history files.
|
||||
|
||||
0.17.0
|
||||
==============================
|
||||
|
@ -123,7 +123,7 @@ def completion(completer=None):
|
||||
try:
|
||||
readline.read_history_file(history)
|
||||
except IOError:
|
||||
open(history, 'a').close()
|
||||
pass
|
||||
|
||||
readline.parse_and_bind(readline_bind)
|
||||
|
||||
@ -131,4 +131,7 @@ def completion(completer=None):
|
||||
yield
|
||||
finally:
|
||||
if docomplete:
|
||||
try:
|
||||
readline.write_history_file(history)
|
||||
except IOError:
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user