diff options
Diffstat (limited to 'Modules/_cursesmodule.c')
-rw-r--r-- | Modules/_cursesmodule.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 06202e0..bde086d 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -203,9 +203,9 @@ PyCurses_ConvertToChtype(PyObject *obj, chtype *ch) *ch = (chtype) PyLong_AsLongAndOverflow(obj, &overflow); if (overflow) return 0; - } else if(PyString_Check(obj) - && (PyString_Size(obj) == 1)) { - *ch = (chtype) *PyString_AsString(obj); + } else if(PyBytes_Check(obj) + && (PyBytes_Size(obj) == 1)) { + *ch = (chtype) *PyBytes_AsString(obj); } else if (PyUnicode_Check(obj) && PyUnicode_GetSize(obj) == 1) { *ch = (chtype) *PyUnicode_AS_UNICODE(obj); } else { @@ -950,7 +950,7 @@ PyCursesWindow_GetStr(PyCursesWindowObject *self, PyObject *args) } if (rtn2 == ERR) rtn[0] = 0; - return PyString_FromString(rtn); + return PyBytes_FromString(rtn); } static PyObject * @@ -1102,7 +1102,7 @@ PyCursesWindow_InStr(PyCursesWindowObject *self, PyObject *args) } if (rtn2 == ERR) rtn[0] = 0; - return PyString_FromString(rtn); + return PyBytes_FromString(rtn); } static PyObject * @@ -1791,7 +1791,7 @@ PyCurses_EraseChar(PyObject *self) ch = erasechar(); - return PyString_FromStringAndSize(&ch, 1); + return PyBytes_FromStringAndSize(&ch, 1); } static PyObject * @@ -1869,7 +1869,7 @@ PyCurses_GetWin(PyCursesWindowObject *self, PyObject *stream) remove(fn); return NULL; } - if (!PyString_Check(data)) { + if (!PyBytes_Check(data)) { PyErr_Format(PyExc_TypeError, "f.read() returned %.100s instead of bytes", data->ob_type->tp_name); @@ -1878,7 +1878,7 @@ PyCurses_GetWin(PyCursesWindowObject *self, PyObject *stream) remove(fn); return NULL; } - fwrite(PyString_AS_STRING(data), 1, PyString_GET_SIZE(data), fp); + fwrite(PyBytes_AS_STRING(data), 1, PyBytes_GET_SIZE(data), fp); Py_DECREF(data); fseek(fp, 0, 0); win = getwin(fp); @@ -2175,7 +2175,7 @@ PyCurses_KeyName(PyObject *self, PyObject *args) } knp = keyname(ch); - return PyString_FromString((knp == NULL) ? "" : (char *)knp); + return PyBytes_FromString((knp == NULL) ? "" : (char *)knp); } #endif @@ -2186,7 +2186,7 @@ PyCurses_KillChar(PyObject *self) ch = killchar(); - return PyString_FromStringAndSize(&ch, 1); + return PyBytes_FromStringAndSize(&ch, 1); } static PyObject * @@ -2557,7 +2557,7 @@ PyCurses_tigetstr(PyObject *self, PyObject *args) Py_INCREF(Py_None); return Py_None; } - return PyString_FromString( capname ); + return PyBytes_FromString( capname ); } static PyObject * @@ -2581,7 +2581,7 @@ PyCurses_tparm(PyObject *self, PyObject *args) return NULL; } - return PyString_FromString(result); + return PyBytes_FromString(result); } static PyObject * @@ -2611,7 +2611,7 @@ PyCurses_UnCtrl(PyObject *self, PyObject *args) return NULL; } - return PyString_FromString(unctrl(ch)); + return PyBytes_FromString(unctrl(ch)); } static PyObject * @@ -2806,7 +2806,7 @@ init_curses(void) PyDict_SetItemString(d, "error", PyCursesError); /* Make the version available */ - v = PyString_FromString(PyCursesVersion); + v = PyBytes_FromString(PyCursesVersion); PyDict_SetItemString(d, "version", v); PyDict_SetItemString(d, "__version__", v); Py_DECREF(v); |