Mercurial > cpython-lru_cache-weakref
diff Modules/cStringIO.c @ 42392:86c13ce60aad
Revert previous checkin.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Sat, 28 Jul 2007 17:57:00 +0000 |
| parents | 785de224995d |
| children | 9918989b733b |
line wrap: on
line diff
--- a/Modules/cStringIO.c Sat Jul 28 17:52:25 2007 +0000 +++ b/Modules/cStringIO.c Sat Jul 28 17:57:00 2007 +0000 @@ -118,8 +118,8 @@ static PyObject * IO_cgetval(PyObject *self) { if (!IO__opencheck(IOOOBJECT(self))) return NULL; - return PyBytes_FromStringAndSize(((IOobject*)self)->buf, - ((IOobject*)self)->pos); + return PyString_FromStringAndSize(((IOobject*)self)->buf, + ((IOobject*)self)->pos); } static PyObject * @@ -136,7 +136,7 @@ } else s=self->string_size; - return PyBytes_FromStringAndSize(self->buf, s); + return PyString_FromStringAndSize(self->buf, s); } PyDoc_STRVAR(IO_isatty__doc__, "isatty(): always returns 0"); @@ -176,7 +176,7 @@ if ( (n=IO_cread((PyObject*)self,&output,n)) < 0) return NULL; - return PyBytes_FromStringAndSize(output, n); + return PyString_FromStringAndSize(output, n); } PyDoc_STRVAR(IO_readline__doc__, "readline() -- Read one line"); @@ -214,7 +214,7 @@ n -= m; self->pos -= m; } - return PyBytes_FromStringAndSize(output, n); + return PyString_FromStringAndSize(output, n); } PyDoc_STRVAR(IO_readlines__doc__, "readlines() -- Read all lines"); @@ -237,7 +237,7 @@ goto err; if (n == 0) break; - line = PyBytes_FromStringAndSize (output, n); + line = PyString_FromStringAndSize (output, n); if (!line) goto err; if (PyList_Append (result, line) == -1) { @@ -314,7 +314,7 @@ next = IO_readline((IOobject *)self, NULL); if (!next) return NULL; - if (!PyBytes_GET_SIZE(next)) { + if (!PyString_GET_SIZE(next)) { Py_DECREF(next); PyErr_SetNone(PyExc_StopIteration); return NULL;
