summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-01-11 07:03:05 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-01-11 07:03:05 (GMT)
commit3540b508844353add804a1ed48e0a73469c385ca (patch)
tree31fad361d7f299011bcb98613b325d66d9d5635c /Python/import.c
parent61ecb7768ff04e9918a461a5b4aa692580c9e113 (diff)
downloadcpython-3540b508844353add804a1ed48e0a73469c385ca.zip
cpython-3540b508844353add804a1ed48e0a73469c385ca.tar.gz
cpython-3540b508844353add804a1ed48e0a73469c385ca.tar.bz2
Good catch Neal!
I completely forgot about pyo files and the tests are usually not run with -O. The modified code checks for *.py?
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index f9d4246..cce854f 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -982,7 +982,8 @@ get_sourcefile(const char *file)
}
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);
}