diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2008-06-09 04:58:54 +0000 |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2008-06-09 04:58:54 +0000 |
commit | dd96db63f689e2f0d8ae5a1436b3b3395eec7de5 (patch) | |
tree | b2299acac9ce44fc488fc7b2ae2a44548cd5fbb8 /Modules/clmodule.c | |
parent | e98839a1f48b2915f1cc747884e64f4d6e4c8e7a (diff) | |
download | cpython-git-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.tar.gz |
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.
Diffstat (limited to 'Modules/clmodule.c')
-rw-r--r-- | Modules/clmodule.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Modules/clmodule.c b/Modules/clmodule.c index b504eed931..d3e0edf3e5 100644 --- a/Modules/clmodule.c +++ b/Modules/clmodule.c @@ -111,7 +111,7 @@ cl_CompressImage(PyObject *self, PyObject *args) return NULL; retry: - compressedBuffer = PyBytes_FromStringAndSize(NULL, frameBufferSize); + compressedBuffer = PyString_FromStringAndSize(NULL, frameBufferSize); if (compressedBuffer == NULL) return NULL; @@ -120,7 +120,7 @@ cl_CompressImage(PyObject *self, PyObject *args) 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 @@ cl_CompressImage(PyObject *self, PyObject *args) } if (compressedBufferSize < frameBufferSize) - _PyBytes_Resize(&compressedBuffer, compressedBufferSize); + _PyString_Resize(&compressedBuffer, compressedBufferSize); return compressedBuffer; } @@ -155,14 +155,14 @@ cl_DecompressImage(PyObject *self, PyObject *args) 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 @@ clm_Compress(PyObject *self, PyObject *args) 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 @@ clm_Compress(PyObject *self, PyObject *args) } if (compressedBufferSize < size) - if (_PyBytes_Resize(&data, compressedBufferSize)) + if (_PyString_Resize(&data, compressedBufferSize)) return NULL; if (compressedBufferSize > size) { @@ -285,14 +285,14 @@ clm_Decompress(PyObject *self, PyObject *args) 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 @@ clm_QueryParams(PyObject *self) 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 @@ clm_GetName(PyObject *self, PyObject *args) return NULL; } - return PyBytes_FromString(name); + return PyString_FromString(name); } static PyObject * @@ -775,7 +775,7 @@ cl_QueryAlgorithms(PyObject *self, PyObject *args) 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 @@ cl_GetAlgorithmName(PyObject *self, PyObject *args) return NULL; } - return PyBytes_FromString(name); + return PyString_FromString(name); } static PyObject * |