Commit 12a024bd authored by Raymond Hettinger's avatar Raymond Hettinger

Fixup error return and add support for intermixed ints and floats/

parent c7f6af21
......@@ -2120,7 +2120,13 @@ builtin_sum(PyObject *self, PyObject *args)
if (PyFloat_CheckExact(item)) {
PyFPE_START_PROTECT("add", return 0)
f_result += PyFloat_AS_DOUBLE(item);
PyFPE_END_PROTECT(a)
PyFPE_END_PROTECT(f_result)
continue;
}
if (PyInt_CheckExact(item)) {
PyFPE_START_PROTECT("add", return 0)
f_result += (double)PyInt_AS_LONG(item);
PyFPE_END_PROTECT(f_result)
continue;
}
result = PyFloat_FromDouble(f_result);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment