cpython: 919259054621 (original) (raw)
Mercurial > cpython
changeset 73763:919259054621
Issue #13415: Help to locate curses.h when _curses module is linked to ncursesw [#13415]
Victor Stinner victor.stinner@haypocalc.com | |
---|---|
date | Sun, 27 Nov 2011 00:19:53 +0100 |
parents | 37300a1df7d7 |
children | 3a44640682c3 |
files | Lib/test/test_curses.py setup.py |
diffstat | 2 files changed, 8 insertions(+), 1 deletions(-)[+] [-] Lib/test/test_curses.py 5 setup.py 4 |
line wrap: on
line diff
--- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -268,7 +268,10 @@ def test_unget_wch(stdscr): if not hasattr(curses, 'unget_wch'): return for ch in ('a', '\xe9', '\u20ac', '\U0010FFFF'):
curses.unget_wch(ch)[](#l1.7)
try:[](#l1.8)
curses.unget_wch(ch)[](#l1.9)
except Exception as err:[](#l1.10)
raise Exception("unget_wch(%a) failed: %s" % (ch, err))[](#l1.11) read = stdscr.get_wch()[](#l1.12) read = chr(read)[](#l1.13) if read != ch:[](#l1.14)
--- a/setup.py +++ b/setup.py @@ -1173,13 +1173,16 @@ class PyBuildExt(build_ext): # Curses support, requiring the System V version of curses, often # provided by the ncurses library. panel_library = 'panel'
curses_includes = [][](#l2.7) if curses_library.startswith('ncurses'):[](#l2.8) if curses_library == 'ncursesw':[](#l2.9) # Bug 1464056: If _curses.so links with ncursesw,[](#l2.10) # _curses_panel.so must link with panelw.[](#l2.11) panel_library = 'panelw'[](#l2.12)
curses_includes = ['/usr/include/ncursesw'][](#l2.13) curses_libs = [curses_library][](#l2.14) exts.append( Extension('_curses', ['_cursesmodule.c'],[](#l2.15)
include_dirs=curses_includes,[](#l2.16) define_macros=curses_defines,[](#l2.17) libraries = curses_libs) )[](#l2.18) elif curses_library == 'curses' and platform != 'darwin':[](#l2.19)
@@ -1202,6 +1205,7 @@ class PyBuildExt(build_ext): 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,[](#l2.24) libraries = [panel_library] + curses_libs) )[](#l2.25) else:[](#l2.26) missing.append('_curses_panel')[](#l2.27)