mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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.
This commit is contained in:
parent
748f40d162
commit
4d91490579
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue