Replace use of PyObject_Str in a couple more places

This commit is contained in:
Kovid Goyal
2018-03-16 21:26:46 +05:30
parent 2cec0908a5
commit 16e77d7329
2 changed files with 2 additions and 2 deletions

View File

@@ -161,7 +161,7 @@ __str__(HistoryBuf *self) {
if (lines == NULL) return PyErr_NoMemory();
for (index_type i = 0; i < self->count; i++) {
init_line(self, index_of(self, i), self->line);
PyObject *t = PyObject_Str((PyObject*)self->line);
PyObject *t = line_as_unicode(self->line);
if (t == NULL) { Py_CLEAR(lines); return NULL; }
PyTuple_SET_ITEM(lines, i, t);
}

View File

@@ -424,7 +424,7 @@ __str__(LineBuf *self) {
if (lines == NULL) return PyErr_NoMemory();
for (index_type i = 0; i < self->ynum; i++) {
init_line(self, self->line, self->line_map[i]);
PyObject *t = PyObject_Str((PyObject*)self->line);
PyObject *t = line_as_unicode(self->line);
if (t == NULL) { Py_CLEAR(lines); return NULL; }
PyTuple_SET_ITEM(lines, i, t);
}