[Python-checkins] cpython: Issue #13415: Help to locate curses.h when _curses module is linked to ncursesw

victor.stinner python-checkins at python.org
Sun Nov 27 00:20:15 CET 2011


http://hg.python.org/cpython/rev/919259054621
changeset:   73763:919259054621
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Sun Nov 27 00:19:53 2011 +0100
summary:
  Issue #13415: Help to locate curses.h when _curses module is linked to ncursesw

files:
  Lib/test/test_curses.py |  5 ++++-
  setup.py                |  4 ++++
  2 files changed, 8 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py
--- a/Lib/test/test_curses.py
+++ b/Lib/test/test_curses.py
@@ -268,7 +268,10 @@
     if not hasattr(curses, 'unget_wch'):
         return
     for ch in ('a', '\xe9', '\u20ac', '\U0010FFFF'):
-        curses.unget_wch(ch)
+        try:
+            curses.unget_wch(ch)
+        except Exception as err:
+            raise Exception("unget_wch(%a) failed: %s" % (ch, err))
         read = stdscr.get_wch()
         read = chr(read)
         if read != ch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1173,13 +1173,16 @@
         # Curses support, requiring the System V version of curses, often
         # provided by the ncurses library.
         panel_library = 'panel'
+        curses_includes = []
         if curses_library.startswith('ncurses'):
             if curses_library == 'ncursesw':
                 # Bug 1464056: If _curses.so links with ncursesw,
                 # _curses_panel.so must link with panelw.
                 panel_library = 'panelw'
+                curses_includes = ['/usr/include/ncursesw']
             curses_libs = [curses_library]
             exts.append( Extension('_curses', ['_cursesmodule.c'],
+                                   include_dirs=curses_includes,
                                    define_macros=curses_defines,
                                    libraries = curses_libs) )
         elif curses_library == 'curses' and platform != 'darwin':
@@ -1202,6 +1205,7 @@
         if (module_enabled(exts, '_curses') and
             self.compiler.find_library_file(lib_dirs, panel_library)):
             exts.append( Extension('_curses_panel', ['_curses_panel.c'],
+                                   include_dirs=curses_includes,
                                    libraries = [panel_library] + curses_libs) )
         else:
             missing.append('_curses_panel')

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list