mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-102939: Fix "conversion from Py_ssize_t to long" warning in builtins (GH-102940)
This commit is contained in:
parent
87be8d9522
commit
0f2ba65805
1 changed files with 2 additions and 2 deletions
|
@ -2503,7 +2503,7 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
|
|||
Py_DECREF(iter);
|
||||
if (PyErr_Occurred())
|
||||
return NULL;
|
||||
return PyLong_FromLong(i_result);
|
||||
return PyLong_FromSsize_t(i_result);
|
||||
}
|
||||
if (PyLong_CheckExact(item) || PyBool_Check(item)) {
|
||||
Py_ssize_t b;
|
||||
|
@ -2525,7 +2525,7 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
|
|||
}
|
||||
}
|
||||
/* Either overflowed or is not an int. Restore real objects and process normally */
|
||||
result = PyLong_FromLong(i_result);
|
||||
result = PyLong_FromSsize_t(i_result);
|
||||
if (result == NULL) {
|
||||
Py_DECREF(item);
|
||||
Py_DECREF(iter);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue