From: Jack Jansen Date: Wed, 25 Dec 2002 22:45:28 +0000 (+0000) Subject: If you entered a pathname for a nonexisting file to a FSSpec constructor X-Git-Tag: v2.3c1~2879 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=00df3e052b25f3de574dd09b4912604ea45c2688;p=python If you entered a pathname for a nonexisting file to a FSSpec constructor on OSX then the actual error (file not found) was obscured by the error message that tried to be helpful about the allowed arguments. Fixed. --- diff --git a/Mac/Modules/file/_Filemodule.c b/Mac/Modules/file/_Filemodule.c index 70a8720abc..0df4c2ec17 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 7238e88782..ffe6c0ee27 100644 --- a/Mac/Modules/file/filesupport.py +++ b/Mac/Modules/file/filesupport.py @@ -195,7 +195,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; }