Commit d48b1062 authored by Jack Jansen's avatar Jack Jansen

In MachoPython expect Unix-style pathnames for both FSSpec and FSRef...

In MachoPython expect Unix-style pathnames for both FSSpec and FSRef initializers. TBD: Do the reverse for MacPython, and also handle as_pathname().
parent 51e77e13
...@@ -1189,11 +1189,21 @@ PyMac_GetFSSpec(PyObject *v, FSSpec *fs) ...@@ -1189,11 +1189,21 @@ PyMac_GetFSSpec(PyObject *v, FSSpec *fs)
if (_mfs_GetFSSpecFromFSRef(v, fs)) if (_mfs_GetFSSpecFromFSRef(v, fs))
return 1; return 1;
if ( PyString_Check(v) ) { 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 */ /* It's a pathname */
if( !PyArg_Parse(v, "O&", PyMac_GetStr255, &path) ) if( !PyArg_Parse(v, "O&", PyMac_GetStr255, &path) )
return 0; return 0;
refnum = 0; /* XXXX Should get CurWD here?? */ refnum = 0; /* XXXX Should get CurWD here?? */
parid = 0; parid = 0;
#endif
} else { } else {
if( !PyArg_Parse(v, "(hlO&); FSSpec should be FSSpec, FSRef, fullpath or (vrefnum,dirid,path)", if( !PyArg_Parse(v, "(hlO&); FSSpec should be FSSpec, FSRef, fullpath or (vrefnum,dirid,path)",
&refnum, &parid, PyMac_GetStr255, &path)) { &refnum, &parid, PyMac_GetStr255, &path)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment