]> granicus.if.org Git - python/commitdiff
OSX workaround: don't crash if the extentions folder can't be found.
authorJust van Rossum <just@letterror.com>
Thu, 13 Dec 2001 17:11:21 +0000 (17:11 +0000)
committerJust van Rossum <just@letterror.com>
Thu, 13 Dec 2001 17:11:21 +0000 (17:11 +0000)
Not sure how to properly solve this.

Mac/Tools/macfreeze/macgen_bin.py

index c72bb3cee3ebb66545e1262e832886632188f3c7..a6de84af059fe94be851f8890aab81cba9b459d7 100644 (file)
@@ -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