Merged revisions 80967 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80967 | ronald.oussoren | 2010-05-08 12:29:06 +0200 (Sat, 08 May 2010) | 4 lines

  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:49:43 +00:00
parent e97ecba241
commit 4cda46ab91
3 changed files with 34 additions and 7 deletions

View file

@ -240,6 +240,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
@ -286,13 +293,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