diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2005-10-03 04:48:15 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2005-10-03 04:48:15 (GMT) |
commit | 708e51a6b1e995ddfe9e15947dc02e4078c6d01a (patch) | |
tree | 83fbef088f472a60809f26448b32ced79ffa3c07 /Python/import.c | |
parent | a45770d6d08c43e1ea16c03b1c4d9ca938a664fd (diff) | |
download | cpython-708e51a6b1e995ddfe9e15947dc02e4078c6d01a.zip cpython-708e51a6b1e995ddfe9e15947dc02e4078c6d01a.tar.gz cpython-708e51a6b1e995ddfe9e15947dc02e4078c6d01a.tar.bz2 |
Fix SF bug #976608, Unhelpful error message when mtime of a module is -1
Will backport.
Diffstat (limited to 'Python/import.c')
-rw-r--r-- | Python/import.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c index 9b624a4..35de13e 100644 --- a/Python/import.c +++ b/Python/import.c @@ -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, |