mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Look for shared libraries first in kLocalDomain and then in kOnSystemDisk.
Don't do sys.prefix==os.getcwd() check unless we're an applet.
This commit is contained in:
parent
8ef786ea95
commit
d11f93c475
2 changed files with 12 additions and 5 deletions
|
@ -46,10 +46,13 @@ def getextensiondirfile(fname):
|
||||||
import macfs
|
import macfs
|
||||||
import MACFS
|
import MACFS
|
||||||
try:
|
try:
|
||||||
vrefnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk, MACFS.kSharedLibrariesFolderType, 0)
|
vrefnum, dirid = macfs.FindFolder(MACFS.kLocalDomain, MACFS.kSharedLibrariesFolderType, 1)
|
||||||
fss = macfs.FSSpec((vrefnum, dirid, fname))
|
|
||||||
except macfs.error:
|
except macfs.error:
|
||||||
return None
|
try:
|
||||||
|
vrefnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk, MACFS.kSharedLibrariesFolderType, 1)
|
||||||
|
except macfs.error:
|
||||||
|
return None
|
||||||
|
fss = macfs.FSSpec((vrefnum, dirid, fname))
|
||||||
return fss.as_pathname()
|
return fss.as_pathname()
|
||||||
|
|
||||||
def mkcorealias(src, altsrc):
|
def mkcorealias(src, altsrc):
|
||||||
|
@ -120,7 +123,11 @@ def main():
|
||||||
oldcwd = os.getcwd()
|
oldcwd = os.getcwd()
|
||||||
os.chdir(sys.prefix)
|
os.chdir(sys.prefix)
|
||||||
newcwd = os.getcwd()
|
newcwd = os.getcwd()
|
||||||
if oldcwd != newcwd:
|
if verbose:
|
||||||
|
print "Not running as applet: Skipping check for preference file correctness."
|
||||||
|
elif oldcwd != newcwd:
|
||||||
|
# Hack to make sure we get the new MACFS
|
||||||
|
sys.path.insert(0, os.path.join(oldcwd, ':Mac:Lib'))
|
||||||
import Dlg
|
import Dlg
|
||||||
rv = Dlg.CautionAlert(ALERT_NOTPYTHONFOLDER, None)
|
rv = Dlg.CautionAlert(ALERT_NOTPYTHONFOLDER, None)
|
||||||
if rv == ALERT_NOTPYTHONFOLDER_REMOVE_QUIT:
|
if rv == ALERT_NOTPYTHONFOLDER_REMOVE_QUIT:
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue