summaryrefslogtreecommitdiff
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2005-07-05 15:21:58 +0000
committerMichael W. Hudson <mwh@python.net>2005-07-05 15:21:58 +0000
commitb89638148b95c4a018fc8f6c4938ffcd0e1b341a (patch)
tree5499792d4dded418ef51c94fce69c83de07c43a9 /Modules/posixmodule.c
parent0257424a2ac6ec89732fb90155657dfd8382b686 (diff)
downloadcpython-git-b89638148b95c4a018fc8f6c4938ffcd0e1b341a.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/posixmodule.c')
-rw-r--r--Modules/posixmodule.c2
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)