mirror of
https://github.com/python/cpython.git
synced 2025-09-05 00:11:10 +00:00
Remove PyInt_CheckExact. Add PyLong_AsLongAndOverflow.
This commit is contained in:
parent
0fbab7ff8d
commit
d1a1d1ed80
15 changed files with 134 additions and 54 deletions
|
@ -3711,14 +3711,7 @@ _PyEval_SliceIndex(PyObject *v, Py_ssize_t *pi)
|
|||
{
|
||||
if (v != NULL) {
|
||||
Py_ssize_t x;
|
||||
if (PyInt_CheckExact(v)) {
|
||||
/* XXX(nnorwitz): I think PyLong_AS_LONG is correct,
|
||||
however, it looks like it should be AsSsize_t.
|
||||
There should be a comment here explaining why.
|
||||
*/
|
||||
x = PyLong_AS_LONG(v);
|
||||
}
|
||||
else if (PyIndex_Check(v)) {
|
||||
if (PyIndex_Check(v)) {
|
||||
x = PyNumber_AsSsize_t(v, NULL);
|
||||
if (x == -1 && PyErr_Occurred())
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue