summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2001-07-14 20:38:30 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2001-07-14 20:38:30 (GMT)
commit5a76c44181465060ecde3588491d5c98eb979a1d (patch)
tree13fbc277cd961e3971ae1f098b7faa0af156374f /Modules
parent9eb27a89d8e37504a685651963c390bf8ebf78ca (diff)
downloadcpython-5a76c44181465060ecde3588491d5c98eb979a1d.zip
cpython-5a76c44181465060ecde3588491d5c98eb979a1d.tar.gz
cpython-5a76c44181465060ecde3588491d5c98eb979a1d.tar.bz2
Fix bug #417212: "curses.newwin can return pads" by changing the Python
newwin() wrapper to always return a window, and never a pad. This makes the code match the documentation.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_cursesmodule.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index beb8c7e..0360994 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -2051,7 +2051,7 @@ static PyObject *
PyCurses_NewWindow(PyObject *self, PyObject *args)
{
WINDOW *win;
- int nlines, ncols, begin_y, begin_x;
+ int nlines, ncols, begin_y=0, begin_x=0;
PyCursesInitialised
@@ -2059,19 +2059,18 @@ PyCurses_NewWindow(PyObject *self, PyObject *args)
case 2:
if (!PyArg_Parse(args,"(ii);nlines,ncols",&nlines,&ncols))
return NULL;
- win = newpad(nlines, ncols);
break;
case 4:
if (!PyArg_Parse(args, "(iiii);nlines,ncols,begin_y,begin_x",
&nlines,&ncols,&begin_y,&begin_x))
return NULL;
- win = newwin(nlines,ncols,begin_y,begin_x);
break;
default:
PyErr_SetString(PyExc_TypeError, "newwin requires 2 or 4 arguments");
return NULL;
}
+ win = newwin(nlines,ncols,begin_y,begin_x);
if (win == NULL) {
PyErr_SetString(PyCursesError, catchall_NULL);
return NULL;