summaryrefslogtreecommitdiffstats
path: root/Lib/site.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-01-28 14:06:58 (GMT)
committerJason R. Coombs <jaraco@jaraco.com>2014-01-28 14:06:58 (GMT)
commit4d91490579ecd0294902deb7717dd18de9ab2e3f (patch)
tree33c3e8bc0bec519a5c2e55b9dacecc9c6ed1c7dc /Lib/site.py
parent748f40d16251a938bb10293943dd9076d800dbaa (diff)
downloadcpython-4d91490579ecd0294902deb7717dd18de9ab2e3f.zip
cpython-4d91490579ecd0294902deb7717dd18de9ab2e3f.tar.gz
cpython-4d91490579ecd0294902deb7717dd18de9ab2e3f.tar.bz2
Issue #20411: Use readline.get_current_history_length to check for the presence of a history, rather than get_history_item, which assumes a history is present.
Diffstat (limited to 'Lib/site.py')
-rw-r--r--Lib/site.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/site.py b/Lib/site.py
index b0d8268..4fb1058 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -409,7 +409,7 @@ def enablerlcompleter():
# want to ignore the exception.
pass
- if readline.get_history_item(1) is None:
+ if readline.get_current_history_length() == 0:
# If no history was loaded, default to .python_history.
# The guard is necessary to avoid doubling history size at
# each interpreter exit when readline was already configured