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/svmodule.c b/Modules/svmodule.c
index 485259f..3845e20 100644
--- a/Modules/svmodule.c
+++ b/Modules/svmodule.c
@@ -47,13 +47,13 @@
if (!PyArg_Parse(args, "i", &invert))
return NULL;
- if (!(output = PyBytes_FromStringAndSize(
+ if (!(output = PyString_FromStringAndSize(
NULL,
(int)(self->ob_info.width * self->ob_info.height * factor))))
{
return NULL;
}
- if (!(outstr = PyBytes_AsString(output))) {
+ if (!(outstr = PyString_AsString(output))) {
Py_DECREF(output);
return NULL;
}
@@ -152,9 +152,9 @@
fieldsize = self->ob_info.width * self->ob_info.height / 2;
obcapture = (char*)self->ob_capture;
- if (!(f1 = PyBytes_FromStringAndSize(obcapture, fieldsize)))
+ if (!(f1 = PyString_FromStringAndSize(obcapture, fieldsize)))
goto finally;
- if (!(f2 = PyBytes_FromStringAndSize(obcapture + fieldsize,
+ if (!(f2 = PyString_FromStringAndSize(obcapture + fieldsize,
fieldsize)))
goto finally;
ret = PyTuple_Pack(2, f1, f2);
@@ -535,12 +535,12 @@
goto finally;
}
- if (!(videodata = PyBytes_FromStringAndSize(NULL, bytes)))
+ if (!(videodata = PyString_FromStringAndSize(NULL, bytes)))
goto finally;
/* XXX -- need to do something about the bitvector */
{
- char* str = PyBytes_AsString(videodata);
+ char* str = PyString_AsString(videodata);
if (!str)
goto finally;
@@ -615,10 +615,10 @@
if (svQueryCaptureBufferSize(self->ob_svideo, &info, &bytes))
return sv_error();
- if (!(videodata = PyBytes_FromStringAndSize(NULL, bytes)))
+ if (!(videodata = PyString_FromStringAndSize(NULL, bytes)))
return NULL;
- str = PyBytes_AsString(videodata);
+ str = PyString_AsString(videodata);
if (!str)
goto finally;
@@ -849,11 +849,11 @@
return NULL;
}
- if (!(output = PyBytes_FromStringAndSize(NULL,
+ if (!(output = PyString_FromStringAndSize(NULL,
(int)(width * height * factor))))
return NULL;
- str = PyBytes_AsString(output);
+ str = PyString_AsString(output);
if (!str) {
Py_DECREF(output);
return NULL;