diff options
author | Georg Brandl <georg@python.org> | 2008-01-26 14:03:51 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-01-26 14:03:51 +0000 |
commit | ee50e3c73472bfe70cdfa66db5ca21d154173be6 (patch) | |
tree | 7ca05e95e9777fcb5bacbc789fb4c992b5ee7a95 | |
parent | 6bf585e753b2e54dc3261a0029e2e16979418d6d (diff) | |
download | cpython-git-ee50e3c73472bfe70cdfa66db5ca21d154173be6.tar.gz |
#1940: make it possible to use curses.filter() before curses.initscr()
as the documentation says.
(backport from rev. 60322)
-rw-r--r-- | Misc/NEWS | 3 | ||||
-rw-r--r-- | Modules/_cursesmodule.c | 11 |
2 files changed, 13 insertions, 1 deletions
@@ -212,6 +212,9 @@ Library Extension Modules ----------------- +- #1940: make it possible to use curses.filter() before curses.initscr() + as the documentation says. + - Fix a potential 'SystemError: NULL result without error' in _ctypes. - Prevent a segfault when a ctypes NULL function pointer is called. diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 1f6a426346..12b496f8ad 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -1619,11 +1619,20 @@ NoArgTrueFalseFunction(has_colors) NoArgTrueFalseFunction(has_ic) NoArgTrueFalseFunction(has_il) NoArgTrueFalseFunction(isendwin) -NoArgNoReturnVoidFunction(filter) NoArgNoReturnVoidFunction(flushinp) NoArgNoReturnVoidFunction(noqiflush) static PyObject * +PyCurses_filter(PyObject *self) +{ + /* not checking for PyCursesInitialised here since filter() must + be called before initscr() */ + filter(); + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject * PyCurses_Color_Content(PyObject *self, PyObject *args) { short color,r,g,b; |