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/ossaudiodev.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/ossaudiodev.c')
-rw-r--r-- | Modules/ossaudiodev.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Modules/ossaudiodev.c b/Modules/ossaudiodev.c index 75f6c15..ebf101a 100644 --- a/Modules/ossaudiodev.c +++ b/Modules/ossaudiodev.c @@ -366,10 +366,10 @@ oss_read(oss_audio_t *self, PyObject *args) if (!PyArg_ParseTuple(args, "i:read", &size)) return NULL; - rv = PyBytes_FromStringAndSize(NULL, size); + rv = PyString_FromStringAndSize(NULL, size); if (rv == NULL) return NULL; - cp = PyBytes_AS_STRING(rv); + cp = PyString_AS_STRING(rv); Py_BEGIN_ALLOW_THREADS count = read(self->fd, cp, size); @@ -381,7 +381,7 @@ oss_read(oss_audio_t *self, PyObject *args) return NULL; } self->icount += count; - _PyBytes_Resize(&rv, count); + _PyString_Resize(&rv, count); return rv; } @@ -811,20 +811,20 @@ oss_getattr(oss_audio_t *self, char *name) Py_INCREF(rval); } else if (strcmp(name, "name") == 0) { - rval = PyBytes_FromString(self->devicename); + rval = PyString_FromString(self->devicename); } else if (strcmp(name, "mode") == 0) { /* No need for a "default" in this switch: from newossobject(), self->mode can only be one of these three values. */ switch(self->mode) { case O_RDONLY: - rval = PyBytes_FromString("r"); + rval = PyString_FromString("r"); break; case O_RDWR: - rval = PyBytes_FromString("rw"); + rval = PyString_FromString("rw"); break; case O_WRONLY: - rval = PyBytes_FromString("w"); + rval = PyString_FromString("w"); break; } } @@ -913,12 +913,12 @@ build_namelists (PyObject *module) if (labels == NULL || names == NULL) goto error2; for (i = 0; i < num_controls; i++) { - s = PyBytes_FromString(control_labels[i]); + s = PyString_FromString(control_labels[i]); if (s == NULL) goto error2; PyList_SET_ITEM(labels, i, s); - s = PyBytes_FromString(control_names[i]); + s = PyString_FromString(control_names[i]); if (s == NULL) goto error2; PyList_SET_ITEM(names, i, s); |