Issue #5845: avoid an exception at startup on OS X if no .editrc file exists.
This commit is contained in:
parent
60bb107ef3
commit
9d351332a7
@ -478,7 +478,15 @@ def enablerlcompleter():
|
|||||||
readline.parse_and_bind('bind ^I rl_complete')
|
readline.parse_and_bind('bind ^I rl_complete')
|
||||||
else:
|
else:
|
||||||
readline.parse_and_bind('tab: complete')
|
readline.parse_and_bind('tab: complete')
|
||||||
|
|
||||||
|
try:
|
||||||
readline.read_init_file()
|
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')
|
history = os.path.join(os.path.expanduser('~'), '.python_history')
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user