[Python-checkins] cpython (2.7): Issue #24266: Cancel history search mode with Ctrl+C in Readline 7

martin.panter python-checkins at python.org
Tue Mar 22 07:17:59 EDT 2016


https://hg.python.org/cpython/rev/1c0b29441116
changeset:   100650:1c0b29441116
branch:      2.7
parent:      100645:86355b610d7c
user:        Martin Panter <vadmium+py at gmail.com>
date:        Tue Mar 22 07:24:05 2016 +0000
summary:
  Issue #24266: Cancel history search mode with Ctrl+C in Readline 7

files:
  Misc/NEWS          |  3 +++
  Modules/readline.c |  3 +++
  2 files changed, 6 insertions(+), 0 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -61,6 +61,9 @@
 Library
 -------
 
+- Issue #24266: Ctrl+C during Readline history search now cancels the search
+  mode when compiled with Readline 7.
+
 - Issue #23857: Implement PEP 493, adding a Python-2-only ssl module API and
   environment variable to configure the default handling of SSL/TLS certificates
   for HTTPS connections.
diff --git a/Modules/readline.c b/Modules/readline.c
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -1024,6 +1024,9 @@
 #endif
             if (s < 0) {
                 rl_free_line_state();
+#if defined(RL_READLINE_VERSION) && RL_READLINE_VERSION >= 0x0700
+                rl_callback_sigcleanup();
+#endif
                 rl_cleanup_after_signal();
                 rl_callback_handler_remove();
                 *signal = 1;

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


More information about the Python-checkins mailing list