forked from astral-sh/python-build-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpatch-readline-libedit.patch
31 lines (27 loc) · 1.15 KB
/
patch-readline-libedit.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff --git a/Modules/readline.c b/Modules/readline.c
index 1e74f997b0..56a36e26e6 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -511,7 +511,7 @@ set the word delimiters for completion");
/* _py_free_history_entry: Utility function to free a history entry. */
-#if defined(RL_READLINE_VERSION) && RL_READLINE_VERSION >= 0x0500
+#ifndef USE_LIBEDIT
/* Readline version >= 5.0 introduced a timestamp field into the history entry
structure; this needs to be freed to avoid a memory leak. This version of
@@ -1055,7 +1055,7 @@ flex_complete(const char *text, int start, int end)
#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
rl_completion_append_character ='\0';
#endif
-#ifdef HAVE_RL_COMPLETION_SUPPRESS_APPEND
+#ifndef USE_LIBEDIT
rl_completion_suppress_append = 0;
#endif
@@ -1241,7 +1241,7 @@ readline_until_enter_or_signal(const char *prompt, int *signal)
PyEval_SaveThread();
if (s < 0) {
rl_free_line_state();
-#if defined(RL_READLINE_VERSION) && RL_READLINE_VERSION >= 0x0700
+#ifndef USE_LIBEDIT
rl_callback_sigcleanup();
#endif
rl_cleanup_after_signal();