static PyObject *
IO_cgetval(PyObject *self) {
if (!IO__opencheck(IOOOBJECT(self))) return NULL;
- return PyString_FromStringAndSize(((IOobject*)self)->buf,
- ((IOobject*)self)->pos);
+ return PyBytes_FromStringAndSize(((IOobject*)self)->buf,
+ ((IOobject*)self)->pos);
}
static PyObject *
}
else
s=self->string_size;
- return PyString_FromStringAndSize(self->buf, s);
+ return PyBytes_FromStringAndSize(self->buf, s);
}
PyDoc_STRVAR(IO_isatty__doc__, "isatty(): always returns 0");
if ( (n=IO_cread((PyObject*)self,&output,n)) < 0) return NULL;
- return PyString_FromStringAndSize(output, n);
+ return PyBytes_FromStringAndSize(output, n);
}
PyDoc_STRVAR(IO_readline__doc__, "readline() -- Read one line");
n -= m;
self->pos -= m;
}
- return PyString_FromStringAndSize(output, n);
+ return PyBytes_FromStringAndSize(output, n);
}
PyDoc_STRVAR(IO_readlines__doc__, "readlines() -- Read all lines");
goto err;
if (n == 0)
break;
- line = PyString_FromStringAndSize (output, n);
+ line = PyBytes_FromStringAndSize (output, n);
if (!line)
goto err;
if (PyList_Append (result, line) == -1) {
next = IO_readline((IOobject *)self, NULL);
if (!next)
return NULL;
- if (!PyString_GET_SIZE(next)) {
+ if (!PyBytes_GET_SIZE(next)) {
Py_DECREF(next);
PyErr_SetNone(PyExc_StopIteration);
return NULL;