Mercurial > cpython-lru_cache-weakref
comparison Python/import.c @ 22957:4f9d5ea4f37d legacy-trunk
Got rid of ifdefs for long-obsolete GUSI versions.
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Thu, 11 Apr 2002 20:46:23 +0000 |
| parents | 15c18bc9d715 |
| children | 8291473fde3e |
comparison
equal
deleted
inserted
replaced
| 22956:03a83340c914 | 22957:4f9d5ea4f37d |
|---|---|
| 1137 #elif defined(DJGPP) | 1137 #elif defined(DJGPP) |
| 1138 #include <dir.h> | 1138 #include <dir.h> |
| 1139 | 1139 |
| 1140 #elif defined(macintosh) | 1140 #elif defined(macintosh) |
| 1141 #include <TextUtils.h> | 1141 #include <TextUtils.h> |
| 1142 #ifdef USE_GUSI1 | |
| 1143 #include "TFileSpec.h" /* for Path2FSSpec() */ | |
| 1144 #endif | |
| 1145 | 1142 |
| 1146 #elif defined(__MACH__) && defined(__APPLE__) && defined(HAVE_DIRENT_H) | 1143 #elif defined(__MACH__) && defined(__APPLE__) && defined(HAVE_DIRENT_H) |
| 1147 #include <sys/types.h> | 1144 #include <sys/types.h> |
| 1148 #include <dirent.h> | 1145 #include <dirent.h> |
| 1149 | 1146 |
| 1213 OSErr err; | 1210 OSErr err; |
| 1214 | 1211 |
| 1215 if (Py_GETENV("PYTHONCASEOK") != NULL) | 1212 if (Py_GETENV("PYTHONCASEOK") != NULL) |
| 1216 return 1; | 1213 return 1; |
| 1217 | 1214 |
| 1218 #ifndef USE_GUSI1 | |
| 1219 err = FSMakeFSSpec(0, 0, Pstring(buf), &fss); | 1215 err = FSMakeFSSpec(0, 0, Pstring(buf), &fss); |
| 1220 #else | |
| 1221 /* GUSI's Path2FSSpec() resolves all possible aliases nicely on | |
| 1222 the way, which is fine for all directories, but here we need | |
| 1223 the original name of the alias file (say, Dlg.ppc.slb, not | |
| 1224 toolboxmodules.ppc.slb). */ | |
| 1225 char *colon; | |
| 1226 err = Path2FSSpec(buf, &fss); | |
| 1227 if (err == noErr) { | |
| 1228 colon = strrchr(buf, ':'); /* find filename */ | |
| 1229 if (colon != NULL) | |
| 1230 err = FSMakeFSSpec(fss.vRefNum, fss.parID, | |
| 1231 Pstring(colon+1), &fss); | |
| 1232 else | |
| 1233 err = FSMakeFSSpec(fss.vRefNum, fss.parID, | |
| 1234 fss.name, &fss); | |
| 1235 } | |
| 1236 #endif | |
| 1237 if (err) { | 1216 if (err) { |
| 1238 PyErr_Format(PyExc_NameError, | 1217 PyErr_Format(PyExc_NameError, |
| 1239 "Can't find file for module %.100s\n(filename %.300s)", | 1218 "Can't find file for module %.100s\n(filename %.300s)", |
| 1240 name, buf); | 1219 name, buf); |
| 1241 return 0; | 1220 return 0; |
