diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2010-05-08 10:49:43 (GMT) |
---|---|---|
committer | Ronald Oussoren <ronaldoussoren@mac.com> | 2010-05-08 10:49:43 (GMT) |
commit | 4cda46ab9167ab6c46e1cbb6caea6fbb021605ac (patch) | |
tree | 9e0c6e4f31d11750664e51b9579ee3c64c1ddbc7 /Lib/site.py | |
parent | e97ecba241118e28100c70c5f48fcaabf32b79b7 (diff) | |
download | cpython-4cda46ab9167ab6c46e1cbb6caea6fbb021605ac.zip cpython-4cda46ab9167ab6c46e1cbb6caea6fbb021605ac.tar.gz cpython-4cda46ab9167ab6c46e1cbb6caea6fbb021605ac.tar.bz2 |
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.
........
Diffstat (limited to 'Lib/site.py')
-rw-r--r-- | Lib/site.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Lib/site.py b/Lib/site.py index d99b538..8563df2 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -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: - sitepackages.append( - os.path.expanduser( - os.path.join("~", "Library", "Python", - sys.version[:3], "site-packages"))) + from sysconfig import get_config_var + framework = get_config_var("PYTHONFRAMEWORK") + if framework and "/%s.framework/"%(framework,) in prefix: sitepackages.append( - os.path.join("/Library", "Python", + os.path.join("/Library", framework, sys.version[:3], "site-packages")) return sitepackages |