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/cdmodule.c b/Modules/cdmodule.c
index 8602d5d..f09b0a4 100644
--- a/Modules/cdmodule.c
+++ b/Modules/cdmodule.c
@@ -239,19 +239,19 @@
if (!PyArg_ParseTuple(args, "i:readda", &numframes))
return NULL;
- result = PyBytes_FromStringAndSize(NULL, numframes * sizeof(CDFRAME));
+ result = PyString_FromStringAndSize(NULL, numframes * sizeof(CDFRAME));
if (result == NULL)
return NULL;
n = CDreadda(self->ob_cdplayer,
- (CDFRAME *) PyBytes_AsString(result), numframes);
+ (CDFRAME *) PyString_AsString(result), numframes);
if (n == -1) {
Py_DECREF(result);
PyErr_SetFromErrno(CdError);
return NULL;
}
if (n < numframes)
- _PyBytes_Resize(&result, n * sizeof(CDFRAME));
+ _PyString_Resize(&result, n * sizeof(CDFRAME));
return result;
}
@@ -468,7 +468,7 @@
PyTuple_SetItem(args, 1, PyInt_FromLong((long) type));
switch (type) {
case cd_audio:
- v = PyBytes_FromStringAndSize(data, CDDA_DATASIZE);
+ v = PyString_FromStringAndSize(data, CDDA_DATASIZE);
break;
case cd_pnum:
case cd_index:
@@ -484,15 +484,15 @@
#undef ptr
break;
case cd_catalog:
- v = PyBytes_FromStringAndSize(NULL, 13);
- p = PyBytes_AsString(v);
+ v = PyString_FromStringAndSize(NULL, 13);
+ p = PyString_AsString(v);
for (i = 0; i < 13; i++)
*p++ = ((char *) data)[i] + '0';
break;
case cd_ident:
#define ptr ((struct cdident *) data)
- v = PyBytes_FromStringAndSize(NULL, 12);
- p = PyBytes_AsString(v);
+ v = PyString_FromStringAndSize(NULL, 12);
+ p = PyString_AsString(v);
CDsbtoa(p, ptr->country, 2);
p += 2;
CDsbtoa(p, ptr->owner, 3);