From: Just van Rossum Date: Thu, 13 Dec 2001 17:11:21 +0000 (+0000) Subject: OSX workaround: don't crash if the extentions folder can't be found. X-Git-Tag: v2.2.1c1~382 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0441dbff16bc7d0528b8f8f96e164350e58101f8;p=python OSX workaround: don't crash if the extentions folder can't be found. Not sure how to properly solve this. --- diff --git a/Mac/Tools/macfreeze/macgen_bin.py b/Mac/Tools/macfreeze/macgen_bin.py index c72bb3cee3..a6de84af05 100644 --- a/Mac/Tools/macfreeze/macgen_bin.py +++ b/Mac/Tools/macfreeze/macgen_bin.py @@ -190,8 +190,12 @@ def copyres(input, output, *args, **kwargs): def findpythoncore(): """find the PythonCore shared library, possibly asking the user if we can't find it""" - vRefNum, dirID = macfs.FindFolder(kOnSystemDisk, kSharedLibrariesFolderType, 0) - extpath = macfs.FSSpec((vRefNum, dirID, "")).as_pathname() + try: + vRefNum, dirID = macfs.FindFolder(kOnSystemDisk, kSharedLibrariesFolderType, 0) + except macfs.error: + extpath = ":" + else: + extpath = macfs.FSSpec((vRefNum, dirID, "")).as_pathname() version = string.split(sys.version)[0] if MacOS.runtimemodel == 'carbon': corename = "PythonCoreCarbon " + version