This reverts r63675 based on the discussion in this thread:
http://mail.python.org/pipermail/python-dev/2008-June/079988.html
Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names
in the spirit of 3.0 are available via a #define only. See the email thread.
diff --git a/Modules/termios.c b/Modules/termios.c
index c6d05ce..c53566c 100644
--- a/Modules/termios.c
+++ b/Modules/termios.c
@@ -91,7 +91,7 @@
return NULL;
for (i = 0; i < NCCS; i++) {
ch = (char)mode.c_cc[i];
- v = PyBytes_FromStringAndSize(&ch, 1);
+ v = PyString_FromStringAndSize(&ch, 1);
if (v == NULL)
goto err;
PyList_SetItem(cc, i, v);
@@ -183,8 +183,8 @@
for (i = 0; i < NCCS; i++) {
v = PyList_GetItem(cc, i);
- if (PyBytes_Check(v) && PyBytes_Size(v) == 1)
- mode.c_cc[i] = (cc_t) * PyBytes_AsString(v);
+ if (PyString_Check(v) && PyString_Size(v) == 1)
+ mode.c_cc[i] = (cc_t) * PyString_AsString(v);
else if (PyInt_Check(v))
mode.c_cc[i] = (cc_t) PyInt_AsLong(v);
else {