Fix bug
[
1232517 ] OverflowError in time.utime() causes strange traceback
A needed error check was missing.
(Actually, this error check may only have become necessary in fairly
recent Python, not sure).
Backport candidate.
[A few lines below the code in 2.4 touched by the patch, there's already
a similar check of (intval == -1 && PyErr_Occurred()), so I think
this function can already report such errors, and therefore the fix
still applies. Perhaps Michael can clarify what he was referring to. --amk]
- Bug #1524310: Properly report errors from FindNextFile in os.listdir.
+- Bug #1232517: An overflow error was not detected properly when
+ attempting to convert a large float to an int in os.utime().
+
- Bug #927248: Recursive method-wrapper objects can now safely
be released.
return -1;
intval = PyInt_AsLong(intobj);
Py_DECREF(intobj);
+ if (intval == -1 && PyErr_Occurred())
+ return -1;
*sec = intval;
*usec = (long)((tval - intval) * 1e6); /* can't exceed 1000000 */
if (*usec < 0)