@@ -401,28 +401,36 @@ cp Modules/readline.c Modules/readline-libedit.c
401
401
# using libedit.
402
402
patch -p1 << EOF
403
403
diff --git a/Modules/readline-libedit.c b/Modules/readline-libedit.c
404
- index 57335fe911..f3e83ff932 100644
404
+ index 1e74f997b0..56a36e26e6 100644
405
405
--- a/Modules/readline-libedit.c
406
406
+++ b/Modules/readline-libedit.c
407
- @@ -486 ,7 +486 ,7 @@ set the word delimiters for completion");
408
-
407
+ @@ -511 ,7 +511 ,7 @@ set the word delimiters for completion");
408
+
409
409
/* _py_free_history_entry: Utility function to free a history entry. */
410
-
410
+
411
411
-#if defined(RL_READLINE_VERSION) && RL_READLINE_VERSION >= 0x0500
412
412
+#ifndef USE_LIBEDIT
413
-
413
+
414
414
/* Readline version >= 5.0 introduced a timestamp field into the history entry
415
415
structure; this needs to be freed to avoid a memory leak. This version of
416
- @@ -1032 ,7 +1032 ,7 @@ flex_complete(const char *text, int start, int end)
416
+ @@ -1055 ,7 +1055 ,7 @@ flex_complete(const char *text, int start, int end)
417
417
#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
418
418
rl_completion_append_character ='\0';
419
419
#endif
420
420
-#ifdef HAVE_RL_COMPLETION_SUPPRESS_APPEND
421
421
+#ifndef USE_LIBEDIT
422
422
rl_completion_suppress_append = 0;
423
423
#endif
424
-
425
-
424
+
425
+ @@ -1241,7 +1241,7 @@ readline_until_enter_or_signal(const char *prompt, int *signal)
426
+ PyEval_SaveThread();
427
+ if (s < 0) {
428
+ rl_free_line_state();
429
+ -#if defined(RL_READLINE_VERSION) && RL_READLINE_VERSION >= 0x0700
430
+ +#ifndef USE_LIBEDIT
431
+ rl_callback_sigcleanup();
432
+ #endif
433
+ rl_cleanup_after_signal();
426
434
EOF
427
435
428
436
# Modules/readline.c has various libedit conditions behind an
0 commit comments