diff options
author | Christian Heimes <christian@cheimes.de> | 2008-05-26 12:51:38 +0000 |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-05-26 12:51:38 +0000 |
commit | 593daf545bd9b7e7bcb27b498ecc6f36db9ae395 (patch) | |
tree | c0a57029b9ab0eb18a2bb4f8fd65f0817f1a1707 /Modules/almodule.c | |
parent | some updates to string formatting section in whatsnew (diff) | |
download | cpython-593daf545bd9b7e7bcb27b498ecc6f36db9ae395.tar.gz cpython-593daf545bd9b7e7bcb27b498ecc6f36db9ae395.tar.bz2 cpython-593daf545bd9b7e7bcb27b498ecc6f36db9ae395.zip |
Renamed PyString to PyBytes
Diffstat (limited to 'Modules/almodule.c')
-rw-r--r-- | Modules/almodule.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Modules/almodule.c b/Modules/almodule.c index 7f48fffed4b..60140aea314 100644 --- a/Modules/almodule.c +++ b/Modules/almodule.c @@ -84,7 +84,7 @@ param2python(int resource, int param, ALvalue value, ALparamInfo *pinfo) Py_INCREF(Py_None); return Py_None; } - return PyString_FromString((char *) value.ptr); + return PyBytes_FromString((char *) value.ptr); default: PyErr_SetString(ErrorObject, "unknown element type"); return NULL; @@ -149,12 +149,12 @@ python2param(int resource, ALpv *param, PyObject *value, ALparamInfo *pinfo) PyErr_SetString(ErrorObject, "unknown element type"); return -1; } - if (!PyString_Check(value)) { + if (!PyBytes_Check(value)) { PyErr_BadArgument(); return -1; } - param->value.ptr = PyString_AS_STRING(value); - param->sizeIn = PyString_GET_SIZE(value)+1; /*account for NUL*/ + param->value.ptr = PyBytes_AS_STRING(value); + param->sizeIn = PyBytes_GET_SIZE(value)+1; /*account for NUL*/ break; case AL_SET_VAL: case AL_VECTOR_VAL: @@ -765,12 +765,12 @@ alp_ReadFrames(alpobject *self, PyObject *args) return NULL; } size *= ch; - v = PyString_FromStringAndSize((char *) NULL, size * framecount); + v = PyBytes_FromStringAndSize((char *) NULL, size * framecount); if (v == NULL) return NULL; Py_BEGIN_ALLOW_THREADS - alReadFrames(self->port, (void *) PyString_AS_STRING(v), framecount); + alReadFrames(self->port, (void *) PyBytes_AS_STRING(v), framecount); Py_END_ALLOW_THREADS return v; @@ -1068,12 +1068,12 @@ alp_readsamps(alpobject *self, PyObject *args) width = ALgetwidth(c); #endif /* AL_405 */ ALfreeconfig(c); - v = PyString_FromStringAndSize((char *)NULL, width * count); + v = PyBytes_FromStringAndSize((char *)NULL, width * count); if (v == NULL) return NULL; Py_BEGIN_ALLOW_THREADS - ret = ALreadsamps(self->port, (void *) PyString_AsString(v), count); + ret = ALreadsamps(self->port, (void *) PyBytes_AsString(v), count); Py_END_ALLOW_THREADS if (ret == -1) { Py_DECREF(v); @@ -1498,7 +1498,7 @@ al_GetParams(PyObject *self, PyObject *args) Py_INCREF(item); break; case AL_STRING_VAL: - item = PyString_FromString(pvs[i].value.ptr); + item = PyBytes_FromString(pvs[i].value.ptr); PyMem_DEL(pvs[i].value.ptr); break; case AL_MATRIX_VAL: @@ -1725,7 +1725,7 @@ al_GetParamInfo(PyObject *self, PyObject *args) PyDict_SetItemString(v, "elementType", item); Py_DECREF(item); - item = PyString_FromString(pinfo.name); + item = PyBytes_FromString(pinfo.name); PyDict_SetItemString(v, "name", item); Py_DECREF(item); @@ -1920,7 +1920,7 @@ al_getname(PyObject *self, PyObject *args) return NULL; if ((name = ALgetname(device, descriptor)) == NULL) return NULL; - return PyString_FromString(name); + return PyBytes_FromString(name); } static PyObject * |