mirror of
https://github.com/python/cpython.git
synced 2025-08-24 18:55:00 +00:00
bpo-47116: use _PyLong_FromUnsignedChar instead of PyLong_FromLong (GH-32110)
This commit is contained in:
parent
e8e737bcf6
commit
c23ddf5ec2
2 changed files with 5 additions and 5 deletions
|
@ -1487,7 +1487,7 @@ bytes_item(PyBytesObject *a, Py_ssize_t i)
|
|||
PyErr_SetString(PyExc_IndexError, "index out of range");
|
||||
return NULL;
|
||||
}
|
||||
return PyLong_FromLong((unsigned char)a->ob_sval[i]);
|
||||
return _PyLong_FromUnsignedChar((unsigned char)a->ob_sval[i]);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -1595,7 +1595,7 @@ bytes_subscript(PyBytesObject* self, PyObject* item)
|
|||
"index out of range");
|
||||
return NULL;
|
||||
}
|
||||
return PyLong_FromLong((unsigned char)self->ob_sval[i]);
|
||||
return _PyLong_FromUnsignedChar((unsigned char)self->ob_sval[i]);
|
||||
}
|
||||
else if (PySlice_Check(item)) {
|
||||
Py_ssize_t start, stop, step, slicelength, i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue