diff Python/import.c @ 44634:06f9f51ab8c0

Good catch Neal! I completely forgot about pyo files and the tests are usually not run with -O. The modified code checks for *.py?
author Christian Heimes <christian@cheimes.de>
date Fri, 11 Jan 2008 07:03:05 +0000
parents a29adc3b0f26
children f380d991390e
line wrap: on
line diff
--- a/Python/import.c	Fri Jan 11 00:32:16 2008 +0000
+++ b/Python/import.c	Fri Jan 11 07:03:05 2008 +0000
@@ -982,7 +982,8 @@
 	}
 
 	len = strlen(file);
-	if (len > MAXPATHLEN || PyOS_stricmp(&file[len-4], ".pyc") != 0) {
+        /* match '*.py?' */
+	if (len > MAXPATHLEN || PyOS_strnicmp(&file[len-4], ".py", 3) != 0) {
 		return PyUnicode_DecodeFSDefault(file);
 	}