Issue #8084: ensure that the --user directory

conforms to platforms standars on OSX when
using a python framework.
This commit is contained in:
Ronald Oussoren 2010-05-08 10:29:06 +00:00
parent 9f8e0c11f0
commit 2f88bfdf96
3 changed files with 37 additions and 7 deletions

View file

@ -243,6 +243,13 @@ def getusersitepackages():
from sysconfig import get_path
import os
if sys.platform == 'darwin':
from sysconfig import get_config_var
if get_config_var('PYTHONFRAMEWORK'):
USER_SITE = get_path('purelib', 'osx_framework_user')
return USER_SITE
USER_SITE = get_path('purelib', '%s_user' % os.name)
return USER_SITE
@ -289,13 +296,11 @@ def getsitepackages():
if sys.platform == "darwin":
# for framework builds *only* we add the standard Apple
# locations.
if 'Python.framework' in prefix:
from sysconfig import get_config_var
framework = get_config_var("PYTHONFRAMEWORK")
if framework and "/%s.framework/"%(framework,) in prefix:
sitepackages.append(
os.path.expanduser(
os.path.join("~", "Library", "Python",
sys.version[:3], "site-packages")))
sitepackages.append(
os.path.join("/Library", "Python",
os.path.join("/Library", framework,
sys.version[:3], "site-packages"))
return sitepackages