Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8b19a93

Browse files
committed
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.
1 parent 504377d commit 8b19a93

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Modules/timemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ time_convert(time_t when, struct tm * (*function)(const time_t *))
273273
if (errno == 0)
274274
errno = EINVAL;
275275
#endif
276-
return PyErr_SetFromErrno(PyExc_IOError);
276+
return PyErr_SetFromErrno(PyExc_ValueError);
277277
}
278278
return tmtotuple(p);
279279
}

0 commit comments

Comments
 (0)