diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2005-10-03 04:50:55 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2005-10-03 04:50:55 (GMT) |
commit | 2d0d6c9b82f8749b9f85ea74365dd2601ac3f524 (patch) | |
tree | a61a97068bd1a244b9ea227526fe10d0c15b44e2 /Python/import.c | |
parent | c2b7c59267153c21a1d53fdba634430723328b74 (diff) | |
download | cpython-2d0d6c9b82f8749b9f85ea74365dd2601ac3f524.zip cpython-2d0d6c9b82f8749b9f85ea74365dd2601ac3f524.tar.gz cpython-2d0d6c9b82f8749b9f85ea74365dd2601ac3f524.tar.bz2 |
Backport:
Fix SF bug #976608, Unhelpful error message when mtime of a module is -1
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 4604714..ee7c593 100644 --- a/Python/import.c +++ b/Python/import.c @@ -867,8 +867,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, |