diff options
author | Antoine Pitrou <pitrou@free.fr> | 2017-07-18 15:05:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-18 15:05:03 (GMT) |
commit | f474c5a3f3c1fbc0383800b88e8518d43a52d1d1 (patch) | |
tree | 9c29ab7759d4e8b23dcf2ba3f0ff84bf94e9e299 /Modules | |
parent | efa26bcd5085279fc4e9ae96d052272a5214c2bd (diff) | |
download | cpython-f474c5a3f3c1fbc0383800b88e8518d43a52d1d1.zip cpython-f474c5a3f3c1fbc0383800b88e8518d43a52d1d1.tar.gz cpython-f474c5a3f3c1fbc0383800b88e8518d43a52d1d1.tar.bz2 |
bpo-30946: Remove obsolete fallback code in readline module (#2738)
* Remove obsolete fallback code in readline module
* Add NEWS
* Remove obsolete include
* Fix macro on Windows
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/readline.c | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/Modules/readline.c b/Modules/readline.c index 7d32c21..f4a5e5a 100644 --- a/Modules/readline.c +++ b/Modules/readline.c @@ -7,7 +7,6 @@ /* Standard definitions */ #include "Python.h" #include <stddef.h> -#include <setjmp.h> #include <signal.h> #include <errno.h> #include <sys/time.h> @@ -1180,10 +1179,7 @@ setup_readline(readlinestate *mod_state) /* Wrapper around GNU readline that handles signals differently. */ - -#if defined(HAVE_RL_CALLBACK) && defined(HAVE_SELECT) - -static char *completed_input_string; +static char *completed_input_string; static void rlhandler(char *text) { @@ -1262,47 +1258,6 @@ readline_until_enter_or_signal(const char *prompt, int *signal) } -#else - -/* Interrupt handler */ - -static jmp_buf jbuf; - -/* ARGSUSED */ -static void -onintr(int sig) -{ - longjmp(jbuf, 1); -} - - -static char * -readline_until_enter_or_signal(const char *prompt, int *signal) -{ - PyOS_sighandler_t old_inthandler; - char *p; - - *signal = 0; - - old_inthandler = PyOS_setsig(SIGINT, onintr); - if (setjmp(jbuf)) { -#ifdef HAVE_SIGRELSE - /* This seems necessary on SunOS 4.1 (Rasmus Hahn) */ - sigrelse(SIGINT); -#endif - PyOS_setsig(SIGINT, old_inthandler); - *signal = 1; - return NULL; - } - rl_event_hook = PyOS_InputHook; - p = readline(prompt); - PyOS_setsig(SIGINT, old_inthandler); - - return p; -} -#endif /*defined(HAVE_RL_CALLBACK) && defined(HAVE_SELECT) */ - - static char * call_readline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt) { |