From: Martin Panter Date: Tue, 22 Mar 2016 07:24:05 +0000 (+0000) Subject: Issue #24266: Cancel history search mode with Ctrl+C in Readline 7 X-Git-Tag: v3.6.0a1~411^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d6990d221b0528fb874561201e9a374bc0b8ac0f;p=python Issue #24266: Cancel history search mode with Ctrl+C in Readline 7 --- diff --git a/Misc/NEWS b/Misc/NEWS index b5672c228b..0058124e57 100644 --- 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. diff --git a/Modules/readline.c b/Modules/readline.c index 1fee935d34..401300395d 100644 --- a/Modules/readline.c +++ b/Modules/readline.c @@ -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;