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/clmodule.c b/Modules/clmodule.c
index b504eed..d3e0edf 100644
--- a/Modules/clmodule.c
+++ b/Modules/clmodule.c
@@ -111,7 +111,7 @@
return NULL;
retry:
- compressedBuffer = PyBytes_FromStringAndSize(NULL, frameBufferSize);
+ compressedBuffer = PyString_FromStringAndSize(NULL, frameBufferSize);
if (compressedBuffer == NULL)
return NULL;
@@ -120,7 +120,7 @@
if (clCompressImage(compressionScheme, width, height, originalFormat,
compressionRatio, (void *) frameBuffer,
&compressedBufferSize,
- (void *) PyBytes_AsString(compressedBuffer))
+ (void *) PyString_AsString(compressedBuffer))
== FAILURE || error_handler_called) {
Py_DECREF(compressedBuffer);
if (!error_handler_called)
@@ -135,7 +135,7 @@
}
if (compressedBufferSize < frameBufferSize)
- _PyBytes_Resize(&compressedBuffer, compressedBufferSize);
+ _PyString_Resize(&compressedBuffer, compressedBufferSize);
return compressedBuffer;
}
@@ -155,14 +155,14 @@
frameBufferSize = width * height * CL_BytesPerPixel(originalFormat);
- frameBuffer = PyBytes_FromStringAndSize(NULL, frameBufferSize);
+ frameBuffer = PyString_FromStringAndSize(NULL, frameBufferSize);
if (frameBuffer == NULL)
return NULL;
error_handler_called = 0;
if (clDecompressImage(compressionScheme, width, height, originalFormat,
compressedBufferSize, compressedBuffer,
- (void *) PyBytes_AsString(frameBuffer))
+ (void *) PyString_AsString(frameBuffer))
== FAILURE || error_handler_called) {
Py_DECREF(frameBuffer);
if (!error_handler_called)
@@ -236,14 +236,14 @@
if (error_handler_called)
return NULL;
- data = PyBytes_FromStringAndSize(NULL, size);
+ data = PyString_FromStringAndSize(NULL, size);
if (data == NULL)
return NULL;
error_handler_called = 0;
if (clCompress(SELF->ob_compressorHdl, numberOfFrames,
(void *) frameBuffer, &compressedBufferSize,
- (void *) PyBytes_AsString(data)) == FAILURE ||
+ (void *) PyString_AsString(data)) == FAILURE ||
error_handler_called) {
Py_DECREF(data);
if (!error_handler_called)
@@ -252,7 +252,7 @@
}
if (compressedBufferSize < size)
- if (_PyBytes_Resize(&data, compressedBufferSize))
+ if (_PyString_Resize(&data, compressedBufferSize))
return NULL;
if (compressedBufferSize > size) {
@@ -285,14 +285,14 @@
if (error_handler_called)
return NULL;
- data = PyBytes_FromStringAndSize(NULL, dataSize);
+ data = PyString_FromStringAndSize(NULL, dataSize);
if (data == NULL)
return NULL;
error_handler_called = 0;
if (clDecompress(SELF->ob_compressorHdl, numberOfFrames,
compressedDataSize, (void *) compressedData,
- (void *) PyBytes_AsString(data)) == FAILURE ||
+ (void *) PyString_AsString(data)) == FAILURE ||
error_handler_called) {
Py_DECREF(data);
if (!error_handler_called)
@@ -514,7 +514,7 @@
PyList_SetItem(list, i, Py_None);
} else
PyList_SetItem(list, i,
- PyBytes_FromString((char *) PVbuffer[i]));
+ PyString_FromString((char *) PVbuffer[i]));
}
PyMem_DEL(PVbuffer);
@@ -563,7 +563,7 @@
return NULL;
}
- return PyBytes_FromString(name);
+ return PyString_FromString(name);
}
static PyObject *
@@ -775,7 +775,7 @@
PyList_SetItem(list, i, Py_None);
} else
PyList_SetItem(list, i,
- PyBytes_FromString((char *) PVbuffer[i]));
+ PyString_FromString((char *) PVbuffer[i]));
}
PyMem_DEL(PVbuffer);
@@ -818,7 +818,7 @@
return NULL;
}
- return PyBytes_FromString(name);
+ return PyString_FromString(name);
}
static PyObject *