summaryrefslogtreecommitdiffstats
path: root/Lib/site.py
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2010-05-08 10:29:06 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2010-05-08 10:29:06 (GMT)
commit2f88bfdf9673a5e14669da375b4aad4a29815fa9 (patch)
treed7cd27e7dfa0720d9afd8c6da1822af961d43b1d /Lib/site.py
parent9f8e0c11f073c7a3e4b78ebf8ea37c919b527829 (diff)
downloadcpython-2f88bfdf9673a5e14669da375b4aad4a29815fa9.zip
cpython-2f88bfdf9673a5e14669da375b4aad4a29815fa9.tar.gz
cpython-2f88bfdf9673a5e14669da375b4aad4a29815fa9.tar.bz2
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.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/Lib/site.py b/Lib/site.py
index 865fffb..cbf3325 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -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:
- 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