When time.localtime() is passed a tick count the platform C localtime()
authorTim Peters <tim.peters@gmail.com>
Fri, 17 Jan 2003 20:08:54 +0000 (20:08 +0000)
committerTim Peters <tim.peters@gmail.com>
Fri, 17 Jan 2003 20:08:54 +0000 (20:08 +0000)
function can't handle, don't raise IOError -- that doesn't make sense.
Raise ValueError instead.

Bugfix candidate.

Modules/timemodule.c

index 7a2f02a8754eb2cec9fafe5782db836baccc4b38..c6880914b8109cf59103b092358ae8215acd6bdc 100644 (file)
@@ -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);
 }