Revert previous checkin.

This commit is contained in:
Martin v. Löwis 2007-07-28 17:57:00 +00:00
parent c582bfca26
commit 1bba9db0c3

View file

@ -118,7 +118,7 @@ PyDoc_STRVAR(IO_getval__doc__,
static PyObject * static PyObject *
IO_cgetval(PyObject *self) { IO_cgetval(PyObject *self) {
if (!IO__opencheck(IOOOBJECT(self))) return NULL; if (!IO__opencheck(IOOOBJECT(self))) return NULL;
return PyBytes_FromStringAndSize(((IOobject*)self)->buf, return PyString_FromStringAndSize(((IOobject*)self)->buf,
((IOobject*)self)->pos); ((IOobject*)self)->pos);
} }
@ -136,7 +136,7 @@ IO_getval(IOobject *self, PyObject *args) {
} }
else else
s=self->string_size; 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"); PyDoc_STRVAR(IO_isatty__doc__, "isatty(): always returns 0");
@ -176,7 +176,7 @@ IO_read(IOobject *self, PyObject *args) {
if ( (n=IO_cread((PyObject*)self,&output,n)) < 0) return NULL; 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"); PyDoc_STRVAR(IO_readline__doc__, "readline() -- Read one line");
@ -214,7 +214,7 @@ IO_readline(IOobject *self, PyObject *args) {
n -= m; n -= m;
self->pos -= m; self->pos -= m;
} }
return PyBytes_FromStringAndSize(output, n); return PyString_FromStringAndSize(output, n);
} }
PyDoc_STRVAR(IO_readlines__doc__, "readlines() -- Read all lines"); PyDoc_STRVAR(IO_readlines__doc__, "readlines() -- Read all lines");
@ -237,7 +237,7 @@ IO_readlines(IOobject *self, PyObject *args) {
goto err; goto err;
if (n == 0) if (n == 0)
break; break;
line = PyBytes_FromStringAndSize (output, n); line = PyString_FromStringAndSize (output, n);
if (!line) if (!line)
goto err; goto err;
if (PyList_Append (result, line) == -1) { if (PyList_Append (result, line) == -1) {
@ -314,7 +314,7 @@ IO_iternext(Iobject *self)
next = IO_readline((IOobject *)self, NULL); next = IO_readline((IOobject *)self, NULL);
if (!next) if (!next)
return NULL; return NULL;
if (!PyBytes_GET_SIZE(next)) { if (!PyString_GET_SIZE(next)) {
Py_DECREF(next); Py_DECREF(next);
PyErr_SetNone(PyExc_StopIteration); PyErr_SetNone(PyExc_StopIteration);
return NULL; return NULL;