mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Renamed PyString to PyBytes
This commit is contained in:
parent
9c4756ea26
commit
72b710a596
78 changed files with 983 additions and 983 deletions
|
@ -1407,13 +1407,13 @@ PyNumber_Long(PyObject *o)
|
|||
}
|
||||
PyErr_Clear(); /* It's not an error if o.__trunc__ doesn't exist. */
|
||||
|
||||
if (PyString_Check(o))
|
||||
if (PyBytes_Check(o))
|
||||
/* need to do extra error checking that PyLong_FromString()
|
||||
* doesn't do. In particular long('9.5') must raise an
|
||||
* exception, not truncate the float.
|
||||
*/
|
||||
return long_from_string(PyString_AS_STRING(o),
|
||||
PyString_GET_SIZE(o));
|
||||
return long_from_string(PyBytes_AS_STRING(o),
|
||||
PyBytes_GET_SIZE(o));
|
||||
if (PyUnicode_Check(o))
|
||||
/* The above check is done in PyLong_FromUnicode(). */
|
||||
return PyLong_FromUnicode(PyUnicode_AS_UNICODE(o),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue