Various tweaks to make it work on MacOSX.
diff --git a/Mac/scripts/ConfigurePython.py b/Mac/scripts/ConfigurePython.py
index 9da7baf..0b55ab3 100644
--- a/Mac/scripts/ConfigurePython.py
+++ b/Mac/scripts/ConfigurePython.py
@@ -11,6 +11,7 @@
import os
import macfs
import MacOS
+import gestalt
SPLASH_COPYCORE=512
SPLASH_COPYCARBON=513
@@ -37,8 +38,11 @@
def getextensiondirfile(fname):
import macfs
import MACFS
- vrefnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk, MACFS.kExtensionFolderType, 0)
- fss = macfs.FSSpec((vrefnum, dirid, fname))
+ try:
+ vrefnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk, MACFS.kExtensionFolderType, 0)
+ fss = macfs.FSSpec((vrefnum, dirid, fname))
+ except macfs.error:
+ return None
return fss.as_pathname()
def mkcorealias(src, altsrc):
@@ -46,6 +50,8 @@
import macostools
version = string.split(sys.version)[0]
dst = getextensiondirfile(src+ ' ' + version)
+ if not dst:
+ return 0
if not os.path.exists(os.path.join(sys.exec_prefix, src)):
if not os.path.exists(os.path.join(sys.exec_prefix, altsrc)):
return 0
@@ -108,6 +114,7 @@
n = n + mkcorealias('PythonCore', 'PythonCore')
n = n + mkcorealias('PythonCoreCarbon', 'PythonCoreCarbon')
if n == 0:
+ import Dlg
Dlg.CautionAlert(ALERT_NOCORE, None)
return
if sys.argv[0][-7:] == 'Classic':