Skip to content
Snippets Groups Projects
Commit 6e9042e2 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Don't whine about missing shell history file

parent 7b4e0e42
Branches
Tags
No related merge requests found
...@@ -144,15 +144,18 @@ def get_shell_hist_filename(): ...@@ -144,15 +144,18 @@ def get_shell_hist_filename():
def setup_readline(): def setup_readline():
try: from os.path import exists
readline.read_history_file(get_shell_hist_filename()) hist_filename = get_shell_hist_filename()
except Exception: if exists(hist_filename):
# http://docs.python.org/3/howto/pyporting.html#capturing-the-currently-raised-exception # noqa try:
import sys readline.read_history_file(hist_filename)
e = sys.exc_info()[1] except Exception:
# http://docs.python.org/3/howto/pyporting.html#capturing-the-currently-raised-exception # noqa
from warnings import warn import sys
warn("Error opening readline history file: %s" % e) e = sys.exc_info()[1]
from warnings import warn
warn("Error opening readline history file: %s" % e)
readline.parse_and_bind("tab: complete") readline.parse_and_bind("tab: complete")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment