python/types-setuptools: update to 75.5.0.20241119
[oi-userland.git] / components / python / python27 / patches / 15-get_wch.patch
blobedc4aca68525f3b0bf7bc06e6982c28b7f8cccf9
1 --- Python-2.7.6/Modules/_cursesmodule.c.~1~ 2013-11-09 23:36:41.000000000 -0800
2 +++ Python-2.7.6/Modules/_cursesmodule.c 2014-05-14 13:36:59.388642793 -0700
3 @@ -861,6 +861,37 @@
6 static PyObject *
7 +PyCursesWindow_Get_WCh(PyCursesWindowObject *self, PyObject *args)
8 +{
9 + int x, y;
10 + int ct;
11 + wint_t rtn;
13 + switch (PyTuple_Size(args)) {
14 + case 0:
15 + Py_BEGIN_ALLOW_THREADS
16 + ct = wget_wch(self->win,&rtn);
17 + Py_END_ALLOW_THREADS
18 + break;
19 + case 2:
20 + if (!PyArg_ParseTuple(args,"ii;y,x",&y,&x))
21 + return NULL;
22 + Py_BEGIN_ALLOW_THREADS
23 + ct = mvwget_wch(self->win,y,x,&rtn);
24 + Py_END_ALLOW_THREADS
25 + break;
26 + default:
27 + PyErr_SetString(PyExc_TypeError, "get_wch requires 0 or 2 arguments");
28 + return NULL;
29 + }
30 + if (ct == ERR) {
31 + PyErr_SetString(PyCursesError, "get_wch failed");
32 + return NULL;
33 + }
34 + return PyInt_FromLong((long)rtn);
37 +static PyObject *
38 PyCursesWindow_GetKey(PyCursesWindowObject *self, PyObject *args)
40 int x, y;
41 @@ -1572,6 +1603,7 @@
42 {"getbegyx", (PyCFunction)PyCursesWindow_getbegyx, METH_NOARGS},
43 {"getbkgd", (PyCFunction)PyCursesWindow_GetBkgd, METH_NOARGS},
44 {"getch", (PyCFunction)PyCursesWindow_GetCh, METH_VARARGS},
45 + {"get_wch", (PyCFunction)PyCursesWindow_Get_WCh, METH_VARARGS},
46 {"getkey", (PyCFunction)PyCursesWindow_GetKey, METH_VARARGS},
47 {"getmaxyx", (PyCFunction)PyCursesWindow_getmaxyx, METH_NOARGS},
48 {"getparyx", (PyCFunction)PyCursesWindow_getparyx, METH_NOARGS},