]> granicus.if.org Git - python/commitdiff
#1940: make it possible to use curses.filter() before curses.initscr()
authorGeorg Brandl <georg@python.org>
Sat, 26 Jan 2008 14:03:47 +0000 (14:03 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 26 Jan 2008 14:03:47 +0000 (14:03 +0000)
as the documentation says.

Misc/NEWS
Modules/_cursesmodule.c

index d88303881ef1ab3e1b4a82aed14de9c86c095201..16034183e4ee094e5016ffbe672238a502ea5875 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -1103,9 +1103,13 @@ Library
   does not claim to support starttls.  Adds the SMTP.ehlo_or_helo_if_needed()
   method.  Patch contributed by Bill Fenner.
 
+
 Extension Modules
 -----------------
 
+- #1940: make it possible to use curses.filter() before curses.initscr()
+  as the documentation says.
+
 - Backport of _fileio module from Python 3.0.
 
 - #1087741: mmap.mmap is now a class, not a factory function. It is also
index 246e8717da7baa9a93ba4acf2854f4a9291ef3c3..137c580731dae9bcc0207f112f160d61979041af 100644 (file)
@@ -1677,10 +1677,19 @@ 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)
 {