summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-02-27 23:22:02 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-02-27 23:22:02 (GMT)
commit64700c9603a9db6d2846990195b14dff1c9c68d0 (patch)
treeb6f5cfda23586172f4a0d65649f700f760fdb305 /Mac
parent9fa7720976d125f0b0b7748c9e9b6e8e9a2891dc (diff)
downloadcpython-64700c9603a9db6d2846990195b14dff1c9c68d0.zip
cpython-64700c9603a9db6d2846990195b14dff1c9c68d0.tar.gz
cpython-64700c9603a9db6d2846990195b14dff1c9c68d0.tar.bz2
Various tweaks to make it work on MacOSX.
Diffstat (limited to 'Mac')
-rw-r--r--Mac/scripts/ConfigurePython.py11
1 files changed, 9 insertions, 2 deletions
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 sys
import os
import macfs
import MacOS
+import gestalt
SPLASH_COPYCORE=512
SPLASH_COPYCARBON=513
@@ -37,8 +38,11 @@ APPLET_LIST=[
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 @@ def mkcorealias(src, altsrc):
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 @@ def main():
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':