aboutsummaryrefslogtreecommitdiffstats
path: root/vt100module.c
diff options
context:
space:
mode:
Diffstat (limited to 'vt100module.c')
-rw-r--r--vt100module.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/vt100module.c b/vt100module.c
index 1eb8f37..9c44ae8 100644
--- a/vt100module.c
+++ b/vt100module.c
@@ -76,7 +76,11 @@ static PyObject *py_vt100_get_string_formatted(PyObject *self, PyObject *args)
vt100_screen_get_string_formatted(vt, &start, &end, &outstr, &outlen);
+#if PY_MAJOR_VERSION == 3
+ return Py_BuildValue("y#", outstr, outlen);
+#else
return Py_BuildValue("s#", outstr, outlen);
+#endif
}
static PyObject *py_vt100_get_string_plaintext(PyObject *self, PyObject *args)
@@ -92,7 +96,11 @@ static PyObject *py_vt100_get_string_plaintext(PyObject *self, PyObject *args)
vt100_screen_get_string_plaintext(vt, &start, &end, &outstr, &outlen);
+#if PY_MAJOR_VERSION == 3
+ return Py_BuildValue("y#", outstr, outlen);
+#else
return Py_BuildValue("s#", outstr, outlen);
+#endif
}
static PyObject *py_vt100_delete(PyObject *self, PyObject *args)