[Python-checkins] python/dist/src/Python import.c,2.244,2.245

nnorwitz@users.sourceforge.net nnorwitz at users.sourceforge.net
Mon Oct 3 06:48:18 CEST 2005


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23608/Python
Modified Files:
	import.c 
Log Message:
Fix SF bug #976608, Unhelpful error message when mtime of a module is -1
Will backport.
Index: import.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/import.c,v
retrieving revision 2.244
retrieving revision 2.245
diff -u -d -r2.244 -r2.245
--- import.c	14 Sep 2005 18:09:42 -0000	2.244
+++ import.c	3 Oct 2005 04:48:15 -0000	2.245
@@ -868,8 +868,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

AltStyle によって変換されたページ (->オリジナル) /