summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2005-10-03 04:50:55 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2005-10-03 04:50:55 (GMT)
commit2d0d6c9b82f8749b9f85ea74365dd2601ac3f524 (patch)
treea61a97068bd1a244b9ea227526fe10d0c15b44e2 /Python/import.c
parentc2b7c59267153c21a1d53fdba634430723328b74 (diff)
downloadcpython-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.c6
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,