mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Renamed PyBytes to PyByteArray
This commit is contained in:
parent
96d02f3c1e
commit
9c4756ea26
31 changed files with 397 additions and 397 deletions
|
@ -1646,7 +1646,7 @@ s_pack_internal(PyStructObject *soself, PyObject *args, int offset, char* buf)
|
|||
return -1;
|
||||
}
|
||||
isstring = PyString_Check(v);
|
||||
if (!isstring && !PyBytes_Check(v)) {
|
||||
if (!isstring && !PyByteArray_Check(v)) {
|
||||
PyErr_SetString(StructError,
|
||||
"argument for 's' must be a string");
|
||||
return -1;
|
||||
|
@ -1656,8 +1656,8 @@ s_pack_internal(PyStructObject *soself, PyObject *args, int offset, char* buf)
|
|||
p = PyString_AS_STRING(v);
|
||||
}
|
||||
else {
|
||||
n = PyBytes_GET_SIZE(v);
|
||||
p = PyBytes_AS_STRING(v);
|
||||
n = PyByteArray_GET_SIZE(v);
|
||||
p = PyByteArray_AS_STRING(v);
|
||||
}
|
||||
if (n > code->size)
|
||||
n = code->size;
|
||||
|
@ -1672,7 +1672,7 @@ s_pack_internal(PyStructObject *soself, PyObject *args, int offset, char* buf)
|
|||
return -1;
|
||||
}
|
||||
isstring = PyString_Check(v);
|
||||
if (!isstring && !PyBytes_Check(v)) {
|
||||
if (!isstring && !PyByteArray_Check(v)) {
|
||||
PyErr_SetString(StructError,
|
||||
"argument for 'p' must be a string");
|
||||
return -1;
|
||||
|
@ -1682,8 +1682,8 @@ s_pack_internal(PyStructObject *soself, PyObject *args, int offset, char* buf)
|
|||
p = PyString_AS_STRING(v);
|
||||
}
|
||||
else {
|
||||
n = PyBytes_GET_SIZE(v);
|
||||
p = PyBytes_AS_STRING(v);
|
||||
n = PyByteArray_GET_SIZE(v);
|
||||
p = PyByteArray_AS_STRING(v);
|
||||
}
|
||||
if (n > (code->size - 1))
|
||||
n = code->size - 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue