diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2017-10-10 22:03:14 (GMT) |
---|---|---|
committer | Mariatta <Mariatta@users.noreply.github.com> | 2017-10-10 22:03:14 (GMT) |
commit | 10eb14e2c5fe08c4193668530eaef156e07c3674 (patch) | |
tree | 81acb34c12ba86d928ce9d038fad4a74b3b2690b /Doc/library | |
parent | a8ac71d15f2a4aef83a8954a678cc12545ce517c (diff) | |
download | cpython-10eb14e2c5fe08c4193668530eaef156e07c3674.zip cpython-10eb14e2c5fe08c4193668530eaef156e07c3674.tar.gz cpython-10eb14e2c5fe08c4193668530eaef156e07c3674.tar.bz2 |
bpo-31537: Update readline documentation example. (GH-3925) (GH-3948)
Change the code example from using `get_history_length` to `get_current_history_length`.
(cherry picked from commit eeb5ffd54e56dd89a99c74eb512c36d62649cfec)
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/readline.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst index 54c54b4..837816e 100644 --- a/Doc/library/readline.rst +++ b/Doc/library/readline.rst @@ -312,13 +312,13 @@ sessions, by only appending the new history. :: try: readline.read_history_file(histfile) - h_len = readline.get_history_length() + h_len = readline.get_current_history_length() except FileNotFoundError: open(histfile, 'wb').close() h_len = 0 def save(prev_h_len, histfile): - new_h_len = readline.get_history_length() + new_h_len = readline.get_current_history_length() readline.set_history_length(1000) readline.append_history_file(new_h_len - prev_h_len, histfile) atexit.register(save, h_len, histfile) |