]> granicus.if.org Git - python/commitdiff
Issue #24266: Cancel history search mode with Ctrl+C in Readline 7
authorMartin Panter <vadmium+py@gmail.com>
Tue, 22 Mar 2016 07:24:05 +0000 (07:24 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Tue, 22 Mar 2016 07:24:05 +0000 (07:24 +0000)
Misc/NEWS
Modules/readline.c

index 3f6ae5d1549e196e5965842d12732db507589098..0ecd9d1c73b8aa780f329750aad3579b3775978b 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -61,6 +61,9 @@ Core and Builtins
 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.
index 1e98ffb9c22d719b24559f05dfb0f69c1397b02e..4aef8793e76afa63679e618e5940e675708a5086 100644 (file)
@@ -1024,6 +1024,9 @@ readline_until_enter_or_signal(char *prompt, int *signal)
 #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;