diff options
Diffstat (limited to 'Mac/Modules/macfsmodule.c')
-rw-r--r-- | Mac/Modules/macfsmodule.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Mac/Modules/macfsmodule.c b/Mac/Modules/macfsmodule.c index 6dba578..2c4f2b3 100644 --- a/Mac/Modules/macfsmodule.c +++ b/Mac/Modules/macfsmodule.c @@ -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)) { |