mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +00:00
Renamed PyString to PyBytes
This commit is contained in:
parent
9c4756ea26
commit
72b710a596
78 changed files with 983 additions and 983 deletions
|
@ -3518,7 +3518,7 @@ long_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
return PyLong_FromUnicode(PyUnicode_AS_UNICODE(x),
|
||||
PyUnicode_GET_SIZE(x),
|
||||
base);
|
||||
else if (PyByteArray_Check(x) || PyString_Check(x)) {
|
||||
else if (PyByteArray_Check(x) || PyBytes_Check(x)) {
|
||||
/* Since PyLong_FromString doesn't have a length parameter,
|
||||
* check here for possible NULs in the string. */
|
||||
char *string;
|
||||
|
@ -3526,7 +3526,7 @@ long_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
if (PyByteArray_Check(x))
|
||||
string = PyByteArray_AS_STRING(x);
|
||||
else
|
||||
string = PyString_AS_STRING(x);
|
||||
string = PyBytes_AS_STRING(x);
|
||||
if (strlen(string) != size) {
|
||||
/* We only see this if there's a null byte in x,
|
||||
x is a bytes or buffer, *and* a base is given. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue