summaryrefslogtreecommitdiffstats
path: root/Python/importdl.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-09-14 13:40:53 (GMT)
committerGuido van Rossum <guido@python.org>1998-09-14 13:40:53 (GMT)
commita0f0a33d0574108c71eeaa5833387658f3b92135 (patch)
treed496cbf02d91c0536ca23fefc551bab093bdfc7e /Python/importdl.c
parentce11393136c1d49a039aea0a3e53bca204ff5481 (diff)
downloadcpython-a0f0a33d0574108c71eeaa5833387658f3b92135.zip
cpython-a0f0a33d0574108c71eeaa5833387658f3b92135.tar.gz
cpython-a0f0a33d0574108c71eeaa5833387658f3b92135.tar.bz2
Mac-specific mod to enable aliases on import paths.
(Jack Jansen and/or Just van Rossum)
Diffstat (limited to 'Python/importdl.c')
-rw-r--r--Python/importdl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Python/importdl.c b/Python/importdl.c
index ef015ad..774b7b3 100644
--- a/Python/importdl.c
+++ b/Python/importdl.c
@@ -249,6 +249,9 @@ typedef void (*dl_funcptr)();
#define CFragConnectionID ConnectionID
#define kLoadCFrag 0x01
#endif
+#ifdef USE_GUSI
+#include "TFileSpec.h" /* for Path2FSSpec() */
+#endif
#include <Files.h>
#include "macdefs.h"
#include "macglue.h"
@@ -372,15 +375,21 @@ _PyImport_LoadDynamicModule(name, pathname, fp)
Ptr mainAddr;
Str255 errMessage;
OSErr err;
+#ifndef USE_GUSI
Boolean isfolder, didsomething;
+#endif
char buf[512];
Str63 fragname;
Ptr symAddr;
CFragSymbolClass class;
/* First resolve any aliases to find the real file */
+#ifdef USE_GUSI
+ err = Path2FSSpec(pathname, &libspec);
+#else
(void)FSMakeFSSpec(0, 0, Pstring(pathname), &libspec);
err = ResolveAliasFile(&libspec, 1, &isfolder, &didsomething);
+#endif
if ( err ) {
sprintf(buf, "%.255s: %.200s",
pathname, PyMac_StrError(err));