diff --git a/kitty/history.c b/kitty/history.c index fa6feb412..ff4857e6b 100644 --- a/kitty/history.c +++ b/kitty/history.c @@ -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); } diff --git a/kitty/line-buf.c b/kitty/line-buf.c index 51092bf0e..6b6699b41 100644 --- a/kitty/line-buf.c +++ b/kitty/line-buf.c @@ -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); }