From 8b19a93b87d6514fec9918cd0b13cefbaca83950 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Fri, 17 Jan 2003 20:08:54 +0000 Subject: [PATCH] When time.localtime() is passed a tick count the platform C localtime() function can't handle, don't raise IOError -- that doesn't make sense. Raise ValueError instead. Bugfix candidate. --- Modules/timemodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 7a2f02a8754..c6880914b81 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -273,7 +273,7 @@ time_convert(time_t when, struct tm * (*function)(const time_t *)) if (errno == 0) errno = EINVAL; #endif - return PyErr_SetFromErrno(PyExc_IOError); + return PyErr_SetFromErrno(PyExc_ValueError); } return tmtotuple(p); }