From: Jason R. Coombs Date: Tue, 28 Jan 2014 14:06:58 +0000 (-0500) Subject: Issue #20411: Use readline.get_current_history_length to check for the presence of... X-Git-Tag: v3.4.0rc1~207 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d91490579ecd0294902deb7717dd18de9ab2e3f;p=python 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. --- diff --git a/Lib/site.py b/Lib/site.py index b0d8268f81..4fb1058a1e 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