mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
Fix SF bug #976608, Unhelpful error message when mtime of a module is -1
Will backport.
This commit is contained in:
parent
a45770d6d0
commit
708e51a6b1
2 changed files with 7 additions and 1 deletions
|
@ -868,8 +868,12 @@ load_source_module(char *name, char *pathname, FILE *fp)
|
|||
PyObject *m;
|
||||
|
||||
mtime = PyOS_GetLastModificationTime(pathname, fp);
|
||||
if (mtime == (time_t)(-1))
|
||||
if (mtime == (time_t)(-1)) {
|
||||
PyErr_Format(PyExc_RuntimeError,
|
||||
"unable to get modification time from '%s'",
|
||||
pathname);
|
||||
return NULL;
|
||||
}
|
||||
#if SIZEOF_TIME_T > 4
|
||||
/* Python's .pyc timestamp handling presumes that the timestamp fits
|
||||
in 4 bytes. This will be fine until sometime in the year 2038,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue