diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2013-05-06 13:39:31 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2013-05-06 13:39:31 (GMT) |
commit | 9d351332a7b65e8e03725bc469b7989ccd68143f (patch) | |
tree | 28460b38fd5b0399757b6fc6f47912a7bee6965f /Lib/site.py | |
parent | 60bb107ef34615d150af24641df1cbb3d3c74521 (diff) | |
download | cpython-9d351332a7b65e8e03725bc469b7989ccd68143f.zip cpython-9d351332a7b65e8e03725bc469b7989ccd68143f.tar.gz cpython-9d351332a7b65e8e03725bc469b7989ccd68143f.tar.bz2 |
Issue #5845: avoid an exception at startup on OS X if no .editrc file exists.
Diffstat (limited to 'Lib/site.py')
-rw-r--r-- | Lib/site.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/site.py b/Lib/site.py index f13d4b4..96a4bef 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -478,7 +478,15 @@ def enablerlcompleter(): readline.parse_and_bind('bind ^I rl_complete') else: readline.parse_and_bind('tab: complete') - readline.read_init_file() + + try: + readline.read_init_file() + except OSError: + # An OSError here could have many causes, but the most likely one + # is that there's no .inputrc file (or .editrc file in the case of + # Mac OS X + libedit) in the expected location. In that case, we + # want to ignore the exception. + pass history = os.path.join(os.path.expanduser('~'), '.python_history') try: |