]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport:
authorNeal Norwitz <nnorwitz@gmail.com>
Tue, 10 Jan 2006 07:08:06 +0000 (07:08 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Tue, 10 Jan 2006 07:08:06 +0000 (07:08 +0000)
SF bug #1400822, Extended version of _curses over{lay,write} does not work

Fix signatures to conform to doc (also fixed ungetmouse()).

Lib/test/test_curses.py
Misc/ACKS
Misc/NEWS
Modules/_cursesmodule.c

index 6f843ad60002967106fefe412f8ba274ee90a4bb..419d8fc280fae0db55e8cb37eaf273978ece12cb 100644 (file)
@@ -5,7 +5,8 @@
 # does call every method and function.
 #
 # Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(),
-# getmouse(), ungetmouse(), init_color()
+# init_color()
+# Only called, not tested: getmouse(), ungetmouse()
 #
 
 import curses, sys, tempfile, os
@@ -106,6 +107,8 @@ def window_funcs(stdscr):
     stdscr.notimeout(1)
     win2.overlay(win)
     win2.overwrite(win)
+    win2.overlay(win, 1, 2, 3, 3, 2, 1)
+    win2.overwrite(win, 1, 2, 3, 3, 2, 1)
     stdscr.redrawln(1,2)
 
     stdscr.scrollok(1)
@@ -201,6 +204,9 @@ def module_funcs(stdscr):
     if hasattr(curses, 'getmouse'):
         curses.mousemask(curses.BUTTON1_PRESSED)
         curses.mouseinterval(10)
+        # just verify these don't cause errors
+        m = curses.getmouse()
+        curses.ungetmouse(*m)
 
 def unit_tests():
     from curses import ascii
index 7faa2c0aa5ee4458dd619feeed4e51d11a70f39a..ff5a9695e3e3e883cd544c5bff750d3e8dd016ef 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -543,6 +543,7 @@ Kirill Simonov
 Nathan Paul Simons
 Janne Sinkkonen
 George Sipe
+J. Sipprell
 Kragen Sitaker
 Christopher Smith
 Gregory P. Smith
index 6d2e8c8999d15b9ac9f182eb882f4b234d8ad695..30591b51fa7ed26b6a3503f14225311396716be8 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -200,6 +200,10 @@ Core and builtins
 Extension Modules
 -----------------
 
+- Bug #1400822, _curses over{lay,write} doesn't work when passing 6 ints.
+  Also fix ungetmouse() which did not accept arguments properly.
+  The code now conforms to the documented signature.
+
 - Bug #1400115, Fix segfault when calling curses.panel.userptr()
   without prior setting of the userptr.
 
index acff973f2a0a07afc1e5343b8b01eb92a0e11c94..c3fffc6032ddc8360826d9fccb4accbf775bf526 100644 (file)
@@ -1163,7 +1163,7 @@ PyCursesWindow_Overlay(PyCursesWindowObject *self, PyObject *args)
            return NULL;
        break;
     case 7:
-       if (!PyArg_ParseTuple(args, "(O!iiiiii);window object, int, int, int, int, int, int",
+       if (!PyArg_ParseTuple(args, "O!iiiiii;window object, int, int, int, int, int, int",
                              &PyCursesWindow_Type, &temp, &sminrow, &smincol,
                              &dminrow, &dmincol, &dmaxrow, &dmaxcol))
            return NULL;
@@ -1201,7 +1201,7 @@ PyCursesWindow_Overwrite(PyCursesWindowObject *self, PyObject *args)
            return NULL;
        break;
     case 7:
-       if (!PyArg_ParseTuple(args, "(O!iiiiii);window object, int, int, int, int, int, int",
+       if (!PyArg_ParseTuple(args, "O!iiiiii;window object, int, int, int, int, int, int",
                              &PyCursesWindow_Type, &temp, &sminrow, &smincol,
                              &dminrow, &dmincol, &dmaxrow, &dmaxcol))
            return NULL;
@@ -1674,7 +1674,7 @@ PyCurses_UngetMouse(PyObject *self, PyObject *args)
        MEVENT event;
 
        PyCursesInitialised
-       if (!PyArg_ParseTuple(args, "(hiiil)",
+       if (!PyArg_ParseTuple(args, "hiiil",
                             &event.id, 
                             &event.x, &event.y, &event.z,
                             (int *) &event.bstate))