cpython: 27b5bd5f0e4c (original) (raw)

Mercurial > cpython

changeset 78831:27b5bd5f0e4c

Close #14223: Fix window.addch(curses.ACS_HLINE) Fix window.addch() of the curses module for special characters like curses.ACS_HLINE: the Python function addch(int) and addch(bytes) is now calling the C function waddch()/mvwaddch() (as it was done in Python 3.2), instead of wadd_wch()/mvwadd_wch(). The Python function addch(str) is still calling the C function wadd_wch()/mvwadd_wch() if the Python curses is linked to libncursesw. [#14223]

Victor Stinner victor.stinner@gmail.com
date Sat, 01 Sep 2012 15:00:34 +0200
parents 895e123d9476
children e2e4a0a49d2e
files Misc/NEWS Modules/_cursesmodule.c
diffstat 2 files changed, 14 insertions(+), 27 deletions(-)[+] [-] Misc/NEWS 7 Modules/_cursesmodule.c 34

line wrap: on

line diff

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -73,6 +73,13 @@ Library always returning an integer. So it is now possible to distinguish special keys like keypad keys. +- Issue #14223: Fix window.addch() of the curses module for special characters

--- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -280,7 +280,6 @@ PyCurses_ConvertToCchar_t(PyCursesWindow #endif ) {

#ifdef HAVE_NCURSESW wchar_t buffer[2]; @@ -304,7 +303,6 @@ PyCurses_ConvertToCchar_t(PyCursesWindow } else if(PyBytes_Check(obj) && PyBytes_Size(obj) == 1) { value = (unsigned char)PyBytes_AsString(obj)[0];

@@ -314,11 +312,6 @@ PyCurses_ConvertToCchar_t(PyCursesWindow "int doesn't fit in long"); return 0; } -#ifdef HAVE_NCURSESW

-#else

-#endif } else { PyErr_Format(PyExc_TypeError, @@ -326,27 +319,14 @@ PyCurses_ConvertToCchar_t(PyCursesWindow Py_TYPE(obj)->tp_name); return 0; } -#ifdef HAVE_NCURSESW

+

-#endif

} /* Convert an object to a byte string (char*) or a wide character string