Skip to content

Commit c95d83c

Browse files
sobolevnFidget-Spinner
authored andcommitted
pythongh-102939: Fix "conversion from Py_ssize_t to long" warning in builtins (pythonGH-102940)
1 parent 828e887 commit c95d83c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Python/bltinmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,7 +2503,7 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
25032503
Py_DECREF(iter);
25042504
if (PyErr_Occurred())
25052505
return NULL;
2506-
return PyLong_FromLong(i_result);
2506+
return PyLong_FromSsize_t(i_result);
25072507
}
25082508
if (PyLong_CheckExact(item) || PyBool_Check(item)) {
25092509
Py_ssize_t b;
@@ -2525,7 +2525,7 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
25252525
}
25262526
}
25272527
/* Either overflowed or is not an int. Restore real objects and process normally */
2528-
result = PyLong_FromLong(i_result);
2528+
result = PyLong_FromSsize_t(i_result);
25292529
if (result == NULL) {
25302530
Py_DECREF(item);
25312531
Py_DECREF(iter);

0 commit comments

Comments
 (0)