Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4df3c52

Browse files
committed
Case-checking was broken on the Macintosh. Fixed.
1 parent fddef43 commit 4df3c52

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Python/import.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -979,13 +979,13 @@ find_module(char *realname, PyObject *path, char *buf, size_t buflen,
979979
#endif
980980
#ifdef macintosh
981981
fdp = PyMac_FindModuleExtension(buf, &len, name);
982-
if (fdp)
983-
fp = fopen(buf, fdp->mode);
982+
if (fdp) {
984983
#else
985984
for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) {
986985
strcpy(buf+len, fdp->suffix);
987986
if (Py_VerboseFlag > 1)
988987
PySys_WriteStderr("# trying %s\n", buf);
988+
#endif /* !macintosh */
989989
fp = fopen(buf, fdp->mode);
990990
if (fp != NULL) {
991991
if (case_ok(buf, len, namelen, name))
@@ -996,7 +996,6 @@ find_module(char *realname, PyObject *path, char *buf, size_t buflen,
996996
}
997997
}
998998
}
999-
#endif /* !macintosh */
1000999
if (fp != NULL)
10011000
break;
10021001
}

0 commit comments

Comments
 (0)