Good catch Neal!

I completely forgot about pyo files and the tests are usually not run with -O. The modified code checks for *.py?
This commit is contained in:
Christian Heimes 2008-01-11 07:03:05 +00:00
parent 61ecb7768f
commit 3540b50884
2 changed files with 4 additions and 2 deletions

View file

@ -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);
}