diff --git a/Mac/Modules/file/_Filemodule.c b/Mac/Modules/file/_Filemodule.c index 70a8720abca..0df4c2ec176 100644 --- a/Mac/Modules/file/_Filemodule.c +++ b/Mac/Modules/file/_Filemodule.c @@ -2671,7 +2671,9 @@ PyMac_GetFSSpec(PyObject *v, FSSpec *spec) } return 1; } +#if !TARGET_API_MAC_OSX PyErr_SetString(PyExc_TypeError, "FSSpec, FSRef, pathname or (refnum, parid, path) required"); +#endif return 0; } diff --git a/Mac/Modules/file/filesupport.py b/Mac/Modules/file/filesupport.py index 7238e887825..ffe6c0ee270 100644 --- a/Mac/Modules/file/filesupport.py +++ b/Mac/Modules/file/filesupport.py @@ -195,7 +195,9 @@ def declare(self, name): } return 1; } +#if !TARGET_API_MAC_OSX PyErr_SetString(PyExc_TypeError, "FSSpec, FSRef, pathname or (refnum, parid, path) required"); +#endif return 0; }