[Python-checkins] python/dist/src/Python import.c, 2.240.2.2, 2.240.2.3

nnorwitz@users.sourceforge.net nnorwitz at users.sourceforge.net
Mon Oct 3 06:50:58 CEST 2005


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24241/Python

Modified Files:
      Tag: release24-maint
	import.c 
Log Message:
Backport:
Fix SF bug #976608, Unhelpful error message when mtime of a module is -1


Index: import.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/import.c,v
retrieving revision 2.240.2.2
retrieving revision 2.240.2.3
diff -u -d -r2.240.2.2 -r2.240.2.3
--- import.c	14 Sep 2005 18:15:03 -0000	2.240.2.2
+++ import.c	3 Oct 2005 04:50:55 -0000	2.240.2.3
@@ -867,8 +867,12 @@
 	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,



More information about the Python-checkins mailing list