mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
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.
This commit is contained in:
parent
0257424a2a
commit
b89638148b
2 changed files with 5 additions and 0 deletions
|
|
@ -1991,6 +1991,8 @@ extract_time(PyObject *t, long* sec, long* usec)
|
|||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue