diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2008-06-09 04:58:54 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2008-06-09 04:58:54 (GMT) |
commit | dd96db63f689e2f0d8ae5a1436b3b3395eec7de5 (patch) | |
tree | b2299acac9ce44fc488fc7b2ae2a44548cd5fbb8 /Modules/svmodule.c | |
parent | e98839a1f48b2915f1cc747884e64f4d6e4c8e7a (diff) | |
download | cpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.zip cpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.tar.gz cpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.tar.bz2 |
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/svmodule.c')
-rw-r--r-- | Modules/svmodule.c | 20 |
1 files changed, 10 insertions, 10 deletions
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 @@ svc_conversion(captureobject *self, PyObject *args, void (*function)(), float fa 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 @@ svc_GetFields(captureobject *self, PyObject *args) 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 @@ sv_CaptureBurst(svobject *self, PyObject *args) 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 @@ sv_CaptureOneFrame(svobject *self, PyObject *args) 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 @@ sv_conversion(PyObject *self, PyObject *args, void (*function)(), 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; |