diff options
author | Christian Heimes <christian@cheimes.de> | 2008-05-26 13:22:05 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-05-26 13:22:05 (GMT) |
commit | 9c4756ea265b5ebd71c9ae59f3673c7cecb6f060 (patch) | |
tree | 642b21e774a9cb2d949e10ce65e7d10326c70138 /Python | |
parent | 96d02f3c1e145821cd5ce8817d4263e7d8d57e4a (diff) | |
download | cpython-9c4756ea265b5ebd71c9ae59f3673c7cecb6f060.zip cpython-9c4756ea265b5ebd71c9ae59f3673c7cecb6f060.tar.gz cpython-9c4756ea265b5ebd71c9ae59f3673c7cecb6f060.tar.bz2 |
Renamed PyBytes to PyByteArray
Diffstat (limited to 'Python')
-rw-r--r-- | Python/bltinmodule.c | 10 | ||||
-rw-r--r-- | Python/codecs.c | 4 | ||||
-rw-r--r-- | Python/getargs.c | 6 | ||||
-rw-r--r-- | Python/marshal.c | 8 | ||||
-rw-r--r-- | Python/pythonrun.c | 4 |
5 files changed, 16 insertions, 16 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 23e87b3..4ff0823 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1377,11 +1377,11 @@ builtin_ord(PyObject *self, PyObject* obj) } #endif } - else if (PyBytes_Check(obj)) { + else if (PyByteArray_Check(obj)) { /* XXX Hopefully this is temporary */ - size = PyBytes_GET_SIZE(obj); + size = PyByteArray_GET_SIZE(obj); if (size == 1) { - ord = (long)((unsigned char)*PyBytes_AS_STRING(obj)); + ord = (long)((unsigned char)*PyByteArray_AS_STRING(obj)); return PyLong_FromLong(ord); } } @@ -1823,7 +1823,7 @@ builtin_sum(PyObject *self, PyObject *args) Py_DECREF(iter); return NULL; } - if (PyBytes_Check(result)) { + if (PyByteArray_Check(result)) { PyErr_SetString(PyExc_TypeError, "sum() can't sum bytes [use b''.join(seq) instead]"); Py_DECREF(iter); @@ -2266,7 +2266,7 @@ _PyBuiltin_Init(void) SETBUILTIN("True", Py_True); SETBUILTIN("bool", &PyBool_Type); SETBUILTIN("memoryview", &PyMemoryView_Type); - SETBUILTIN("bytearray", &PyBytes_Type); + SETBUILTIN("bytearray", &PyByteArray_Type); SETBUILTIN("bytes", &PyString_Type); SETBUILTIN("classmethod", &PyClassMethod_Type); #ifndef WITHOUT_COMPLEX diff --git a/Python/codecs.c b/Python/codecs.c index 86941b1..554c1d2 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -345,7 +345,7 @@ PyObject *PyCodec_Encode(PyObject *object, goto onError; } v = PyTuple_GET_ITEM(result, 0); - if (PyBytes_Check(v)) { + if (PyByteArray_Check(v)) { char msg[100]; PyOS_snprintf(msg, sizeof(msg), "encoder %s returned buffer instead of bytes", @@ -354,7 +354,7 @@ PyObject *PyCodec_Encode(PyObject *object, v = NULL; goto onError; } - v = PyString_FromStringAndSize(PyBytes_AS_STRING(v), Py_SIZE(v)); + v = PyString_FromStringAndSize(PyByteArray_AS_STRING(v), Py_SIZE(v)); } else if (PyString_Check(v)) Py_INCREF(v); diff --git a/Python/getargs.c b/Python/getargs.c index 7ca7672..2289bb6 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -971,7 +971,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, /* Encode object */ if (!recode_strings && - (PyString_Check(arg) || PyBytes_Check(arg))) { + (PyString_Check(arg) || PyByteArray_Check(arg))) { s = arg; Py_INCREF(s); if (PyObject_AsCharBuffer(s, &ptr, &size) < 0) @@ -1123,9 +1123,9 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, break; } - case 'Y': { /* PyBytes object */ + case 'Y': { /* PyByteArray object */ PyObject **p = va_arg(*p_va, PyObject **); - if (PyBytes_Check(arg)) + if (PyByteArray_Check(arg)) *p = arg; else return converterr("buffer", arg, msgbuf, bufsize); diff --git a/Python/marshal.c b/Python/marshal.c index ce828da..5672a06 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -1095,7 +1095,7 @@ PyMarshal_WriteObjectToString(PyObject *x, int version) } if (wf.str != NULL) { /* XXX Quick hack -- need to do this differently */ - res = PyBytes_FromObject(wf.str); + res = PyByteArray_FromObject(wf.str); Py_DECREF(wf.str); } return res; @@ -1136,9 +1136,9 @@ marshal_load(PyObject *self, PyObject *f) rf.ptr = PyString_AS_STRING(data); rf.end = rf.ptr + PyString_GET_SIZE(data); } - else if (PyBytes_Check(data)) { - rf.ptr = PyBytes_AS_STRING(data); - rf.end = rf.ptr + PyBytes_GET_SIZE(data); + else if (PyByteArray_Check(data)) { + rf.ptr = PyByteArray_AS_STRING(data); + rf.end = rf.ptr + PyByteArray_GET_SIZE(data); } else { PyErr_Format(PyExc_TypeError, diff --git a/Python/pythonrun.c b/Python/pythonrun.c index e2bddcb..7f6966a 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -175,7 +175,7 @@ Py_InitializeEx(int install_sigs) if (!_PyLong_Init()) Py_FatalError("Py_Initialize: can't init longs"); - if (!PyBytes_Init()) + if (!PyByteArray_Init()) Py_FatalError("Py_Initialize: can't init bytes"); _PyFloat_Init(); @@ -460,7 +460,7 @@ Py_Finalize(void) PyList_Fini(); PySet_Fini(); PyString_Fini(); - PyBytes_Fini(); + PyByteArray_Fini(); PyLong_Fini(); PyFloat_Fini(); PyDict_Fini(); |