From: Tim Peters Date: Fri, 17 Jan 2003 20:08:54 +0000 (+0000) Subject: When time.localtime() is passed a tick count the platform C localtime() X-Git-Tag: v2.3c1~2421 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8b19a93b87d6514fec9918cd0b13cefbaca83950;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 7a2f02a8754e..c6880914b810 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); }