[Python-checkins] CVS: python/dist/src/Mac/Modules macfsmodule.c,1.51,1.52
Jack Jansen
jackjansen@users.sourceforge.net
Sun, 13 Jan 2002 15:16:34 -0800
Update of /cvsroot/python/python/dist/src/Mac/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv17259
Modified Files:
macfsmodule.c
Log Message:
In MachoPython expect Unix-style pathnames for both FSSpec and FSRef initializers. TBD: Do the reverse for MacPython, and also handle as_pathname().
Index: macfsmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macfsmodule.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** macfsmodule.c 2001/12/11 14:04:12 1.51
--- macfsmodule.c 2002/01/13 23:16:32 1.52
***************
*** 1190,1193 ****
--- 1190,1202 ----
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) )
***************
*** 1195,1198 ****
--- 1204,1208 ----
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)",