]> 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 b5672c228baa9f21076604cef1f4e1ce750b991a..0058124e570dcea5f6f94612621fbc1690d46fb6 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -94,6 +94,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #24266: Ctrl+C during Readline history search now cancels the search
+  mode when compiled with Readline 7.
+
 - Issue #26560: Avoid potential ValueError in BaseHandler.start_response.
   Initial patch by Peter Inglesby.
 
index 1fee935d34d7882f2198fbf6f61da752a6a8db95..401300395dee68d60e2b6afd1e86e5702542a66a 100644 (file)
@@ -1140,6 +1140,9 @@ readline_until_enter_or_signal(const 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;