]> granicus.if.org Git - python/commitdiff
In MachoPython expect Unix-style pathnames for both FSSpec and FSRef initializers...
authorJack Jansen <jack.jansen@cwi.nl>
Sun, 13 Jan 2002 23:16:32 +0000 (23:16 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Sun, 13 Jan 2002 23:16:32 +0000 (23:16 +0000)
Mac/Modules/macfsmodule.c

index 6dba5782562f2e551512c416f6eb404bd682a7e7..2c4f2b3f5995063dac48cd89cafcd756f521c85c 100644 (file)
@@ -1189,11 +1189,21 @@ PyMac_GetFSSpec(PyObject *v, FSSpec *fs)
        if (_mfs_GetFSSpecFromFSRef(v, fs))
                return 1;
        if ( PyString_Check(v) ) {
+#if TARGET_API_MAC_OSX
+               FSRef fsr;
+               
+               if ( !PyMac_GetFSRef(v, &fsr) )
+                       return 0;
+               if ( FSGetCatalogInfo(&fsr, kFSCatInfoNone, NULL, NULL, fs, NULL) == noErr )
+                       return 1;
+               return 0;
+#else
                /* It's a pathname */
                if( !PyArg_Parse(v, "O&", PyMac_GetStr255, &path) )
                        return 0;
                refnum = 0; /* XXXX Should get CurWD here?? */
                parid = 0;
+#endif
        } else {
                if( !PyArg_Parse(v, "(hlO&); FSSpec should be FSSpec, FSRef, fullpath or (vrefnum,dirid,path)",
                                                        &refnum, &parid, PyMac_GetStr255, &path)) {