Skip to content

Commit 94250a7

Browse files
authored
gh-157695: Make HAVE_RL_CHANGE_ENVIRONMENT macro private (#162213)
Rename HAVE_RL_CHANGE_ENVIRONMENT macro to _Py_HAVE_RL_CHANGE_ENVIRONMENT (make it private).
1 parent abbfbce commit 94250a7

6 files changed

Lines changed: 7 additions & 8 deletions

File tree

‎Lib/test/test_readline.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ def test_write_read_limited_history(self):
471471
# So, we've only tested that the read did not fail.
472472
# See TestHistoryManipulation for the full test.
473473

474-
@unittest.skipUnless(sysconfig.get_config_var("HAVE_RL_CHANGE_ENVIRONMENT"),
474+
@unittest.skipUnless(sysconfig.get_config_var("_Py_HAVE_RL_CHANGE_ENVIRONMENT"),
475475
"readline can modify the environment")
476476
def test_environment_is_not_modified(self):
477477
# os.environ contains environment at the time "os" module was loaded, so

‎Modules/readline.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1543,7 +1543,7 @@ setup_readline(readlinestate *mod_state)
15431543
/* The name must be defined before initialization */
15441544
rl_readline_name = "python";
15451545

1546-
#ifdef HAVE_RL_CHANGE_ENVIRONMENT
1546+
#ifdef _Py_HAVE_RL_CHANGE_ENVIRONMENT
15471547
/* Prevent readline from setting the LINES and COLUMNS environment
15481548
* variables: ncurses prefers them over an ioctl() query, so a stale value
15491549
* left after a resize breaks SIGWINCH / KEY_RESIZE handling (gh-46927). */

‎Tools/build/check_capi_macros_ignored.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,6 @@ HAVE_RECVFROM
435435
HAVE_RENAMEAT
436436
HAVE_RL_APPEND_HISTORY
437437
HAVE_RL_CATCH_SIGNAL
438-
HAVE_RL_CHANGE_ENVIRONMENT
439438
HAVE_RL_COMPDISP_FUNC_T
440439
HAVE_RL_COMPLETION_APPEND_CHARACTER
441440
HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK

‎configure‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎configure.ac‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7261,7 +7261,7 @@ AS_VAR_IF([with_readline], [no], [
72617261
)
72627262
])
72637263
AS_VAR_IF([ac_cv_readline_rl_change_environment], [yes], [
7264-
AC_DEFINE([HAVE_RL_CHANGE_ENVIRONMENT], [1], [Define if you have readline 6.3])
7264+
AC_DEFINE([_Py_HAVE_RL_CHANGE_ENVIRONMENT], [1], [Define if you have readline 6.3])
72657265
])
72667266
72677267
# check for readline 4.2

‎pyconfig.h.in‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,9 +1143,6 @@
11431143
/* Define if you can turn off readline's signal handling. */
11441144
#undef HAVE_RL_CATCH_SIGNAL
11451145

1146-
/* Define if you have readline 6.3 */
1147-
#undef HAVE_RL_CHANGE_ENVIRONMENT
1148-
11491146
/* Define to 1 if the system has the type 'rl_compdisp_func_t'. */
11501147
#undef HAVE_RL_COMPDISP_FUNC_T
11511148

@@ -2164,6 +2161,9 @@
21642161
/* Define if you have the 'pthread_attr_get_np' function. */
21652162
#undef _Py_HAVE_PTHREAD_ATTR_GET_NP
21662163

2164+
/* Define if you have readline 6.3 */
2165+
#undef _Py_HAVE_RL_CHANGE_ENVIRONMENT
2166+
21672167
/* Define if you have the 'sinpi' function. */
21682168
#undef _Py_HAVE_SINPI
21692169

0 commit comments

Comments
 (0)