summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-01-10 07:05:44 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-01-10 07:05:44 (GMT)
commit88bbd73d0763bb4df48d45791dafbef76c2e17a5 (patch)
treebe74a99859ee5f4b03f91a643a683132d7f3cbd4
parentfc76d633e8017fd948bc2363738cbdea41586e21 (diff)
downloadcpython-88bbd73d0763bb4df48d45791dafbef76c2e17a5.zip
cpython-88bbd73d0763bb4df48d45791dafbef76c2e17a5.tar.gz
cpython-88bbd73d0763bb4df48d45791dafbef76c2e17a5.tar.bz2
SF bug #1400822, Extended version of _curses over{lay,write} does not work
Fix signatures to conform to doc (also fixed ungetmouse()). Will backport.
-rw-r--r--Lib/test/test_curses.py8
-rw-r--r--Misc/ACKS1
-rw-r--r--Misc/NEWS4
-rw-r--r--Modules/_cursesmodule.c6
4 files changed, 15 insertions, 4 deletions
diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py
index 6f843ad..419d8fc 100644
--- a/Lib/test/test_curses.py
+++ b/Lib/test/test_curses.py
@@ -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
diff --git a/Misc/ACKS b/Misc/ACKS
index b717a36..42fa409 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -552,6 +552,7 @@ Kirill Simonov
Nathan Paul Simons
Janne Sinkkonen
George Sipe
+J. Sipprell
Kragen Sitaker
Christopher Smith
Gregory P. Smith
diff --git a/Misc/NEWS b/Misc/NEWS
index 78cf145..d5a2361 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -216,6 +216,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.
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 2d7f6e0..176f024 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -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))