[Python-checkins] cpython: Issue #20411: Use readline.get_current_history_length to check for the presence

jason.coombs python-checkins at python.org
Tue Jan 28 15:18:12 CET 2014


http://hg.python.org/cpython/rev/ca6efeedfc0e
changeset:   88794:ca6efeedfc0e
user:        Jason R. Coombs <jaraco at jaraco.com>
date:        Tue Jan 28 09:06:58 2014 -0500
summary:
  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.

files:
  Lib/site.py |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Lib/site.py b/Lib/site.py
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -409,7 +409,7 @@
             # 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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list