[Python-checkins] bpo-45067 - Verify the version of ncurses for extended color support feature usage. (GH-28260)

miss-islington webhook-mailer at python.org
Thu Sep 9 15:39:03 EDT 2021


https://github.com/python/cpython/commit/b86437bb15fbaba55f9e56661598b4d5a3db86bb
commit: b86437bb15fbaba55f9e56661598b4d5a3db86bb
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2021-09-09T12:38:54-07:00
summary:

bpo-45067 - Verify the version of ncurses for extended color support feature usage. (GH-28260)


* issue45067 - Fix _curses compilation in CentOS 7. Verify the version of ncurses
for extended color support feature usage.

The function extended_color_content was introduced in 2017.  The ncurses-devel
package in CentOS 7 had a older version ncurses resulted in compilation error.
For compiling ncurses with extended color support, we verify the version of the
ncurses library.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka at gmail.com>
(cherry picked from commit 794430700defb913512f871b701a888aa730de81)

Co-authored-by: Senthil Kumaran <senthil at python.org>

files:
A Misc/NEWS.d/next/Build/2021-09-09-16-45-26.bpo-45067.mFmY92.rst
M Modules/_cursesmodule.c

diff --git a/Misc/NEWS.d/next/Build/2021-09-09-16-45-26.bpo-45067.mFmY92.rst b/Misc/NEWS.d/next/Build/2021-09-09-16-45-26.bpo-45067.mFmY92.rst
new file mode 100644
index 0000000000000..b64a899bd3372
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2021-09-09-16-45-26.bpo-45067.mFmY92.rst
@@ -0,0 +1,5 @@
+The ncurses function extended_color_content was introduced in 2017.
+https://invisible-island.net/ncurses/NEWS.html#index-t20170401) The
+ncurses-devel package in CentOS 7 had a older version ncurses resulted in
+compilation error.  For compiling ncurses with extended color support, we
+verify the version of the ncurses library >= 20170401.
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 61aaf855229f8..511073f2ac137 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -135,11 +135,11 @@ typedef chtype attr_t;           /* No attr_t type is available */
 #define STRICT_SYSV_CURSES
 #endif
 
-#if NCURSES_EXT_COLORS+0 && NCURSES_EXT_FUNCS+0
+#if NCURSES_EXT_FUNCS+0 >= 20170401 && NCURSES_EXT_COLORS+0 >= 20170401
 #define _NCURSES_EXTENDED_COLOR_FUNCS   1
 #else
 #define _NCURSES_EXTENDED_COLOR_FUNCS   0
-#endif  /* defined(NCURSES_EXT_COLORS) && defined(NCURSES_EXT_FUNCS)  */
+#endif
 
 #if _NCURSES_EXTENDED_COLOR_FUNCS
 #define _CURSES_COLOR_VAL_TYPE          int



More information about the Python-checkins mailing list