Mercurial > cpython-lru_cache-weakref
comparison Mac/scripts/ConfigurePython.py @ 17247:59472bcbfb8e legacy-trunk
On OSX always copy PythonCore. It turns out an orphaned alias in /Library/CFMSupport (happens when you remove python and aliased pythoncore) wreaks havoc with the system.
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Thu, 29 Mar 2001 13:53:19 +0000 |
| parents | 1f700a7206b2 |
| children | 42b2f1936254 |
comparison
equal
deleted
inserted
replaced
| 17246:75103bef0c24 | 17247:59472bcbfb8e |
|---|---|
| 68 src = altsrc | 68 src = altsrc |
| 69 try: | 69 try: |
| 70 os.unlink(dst) | 70 os.unlink(dst) |
| 71 except os.error: | 71 except os.error: |
| 72 pass | 72 pass |
| 73 do_copy = ask_copy() | |
| 74 if do_copy: | |
| 75 macostools.copy(os.path.join(sys.exec_prefix, src), dst) | |
| 76 else: | |
| 77 macostools.mkalias(os.path.join(sys.exec_prefix, src), dst) | |
| 78 return 1 | |
| 79 | |
| 80 do_copy = None | |
| 81 def ask_copy(): | |
| 82 global do_copy | |
| 83 if do_copy != None: | |
| 84 return do_copy | |
| 85 # On OSX always copy | |
| 86 if gestalt.gestalt('sysv') > 0x9ff: | |
| 87 do_copy = 1 | |
| 88 return do_copy | |
| 73 do_copy = 0 | 89 do_copy = 0 |
| 74 if macfs.FSSpec(sys.exec_prefix).as_tuple()[0] != -1: # XXXX | 90 if macfs.FSSpec(sys.exec_prefix).as_tuple()[0] != -1: # XXXX |
| 75 try: | 91 try: |
| 76 import Dlg | 92 import Dlg |
| 77 rv = Dlg.CautionAlert(ALERT_NONBOOT, None) | 93 rv = Dlg.CautionAlert(ALERT_NONBOOT, None) |
| 78 if rv == ALERT_NONBOOT_COPY: | 94 if rv == ALERT_NONBOOT_COPY: |
| 79 do_copy = 1 | 95 do_copy = 1 |
| 80 except ImportError: | 96 except ImportError: |
| 81 pass | 97 pass |
| 82 if do_copy: | 98 return do_copy |
| 83 macostools.copy(os.path.join(sys.exec_prefix, src), dst) | 99 |
| 84 else: | |
| 85 macostools.mkalias(os.path.join(sys.exec_prefix, src), dst) | |
| 86 return 1 | |
| 87 | 100 |
| 88 # Copied from fullbuild, should probably go to buildtools | 101 # Copied from fullbuild, should probably go to buildtools |
| 89 def buildapplet(top, dummy, list): | 102 def buildapplet(top, dummy, list): |
| 90 """Create python applets""" | 103 """Create python applets""" |
| 91 import buildtools | 104 import buildtools |
