From 2d0d6c9b82f8749b9f85ea74365dd2601ac3f524 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Mon, 3 Oct 2005 04:50:55 +0000 Subject: Backport: Fix SF bug #976608, Unhelpful error message when mtime of a module is -1 --- Python/import.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Python') diff --git a/Python/import.c b/Python/import.c index 460471403a..ee7c59300e 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, -- cgit v1.2.1