[Python-checkins] r60323 - in python/branches/release25-maint: Misc/NEWS Modules/_cursesmodule.c

georg.brandl python-checkins at python.org
Sat Jan 26 15:03:52 CET 2008


Author: georg.brandl
Date: Sat Jan 26 15:03:51 2008
New Revision: 60323

Modified:
   python/branches/release25-maint/Misc/NEWS
   python/branches/release25-maint/Modules/_cursesmodule.c
Log:
#1940: make it possible to use curses.filter() before curses.initscr()
as the documentation says.
 (backport from rev. 60322)

Modified: python/branches/release25-maint/Misc/NEWS
==============================================================================
--- python/branches/release25-maint/Misc/NEWS	(original)
+++ python/branches/release25-maint/Misc/NEWS	Sat Jan 26 15:03:51 2008
@@ -212,6 +212,9 @@
 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.

Modified: python/branches/release25-maint/Modules/_cursesmodule.c
==============================================================================
--- python/branches/release25-maint/Modules/_cursesmodule.c	(original)
+++ python/branches/release25-maint/Modules/_cursesmodule.c	Sat Jan 26 15:03:51 2008
@@ -1619,11 +1619,20 @@
 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;


More information about the Python-checkins mailing list