diff options
author | Michael W. Hudson <mwh@python.net> | 2005-07-05 15:21:58 +0000 |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2005-07-05 15:21:58 +0000 |
commit | 828f710f137f93a3f6c0e472624c742f447ee605 (patch) | |
tree | a67baa01c896d7e47475ff69b9392638f52a2a90 /Modules | |
parent | 6258e2367287617eeb60be0a9e54ac75fe2562a0 (diff) | |
download | cpython-828f710f137f93a3f6c0e472624c742f447ee605.tar.gz |
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.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/posixmodule.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index e4a0200f04..e0c2b7f4f9 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -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) |