diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2010-05-08 10:29:06 +0000 |
---|---|---|
committer | Ronald Oussoren <ronaldoussoren@mac.com> | 2010-05-08 10:29:06 +0000 |
commit | 2f88bfdf9673a5e14669da375b4aad4a29815fa9 (patch) | |
tree | d7cd27e7dfa0720d9afd8c6da1822af961d43b1d /Lib/sysconfig.py | |
parent | 9f8e0c11f073c7a3e4b78ebf8ea37c919b527829 (diff) | |
download | cpython-git-2f88bfdf9673a5e14669da375b4aad4a29815fa9.tar.gz |
Issue #8084: ensure that the --user directory
conforms to platforms standars on OSX when
using a python framework.
Diffstat (limited to 'Lib/sysconfig.py')
-rw-r--r-- | Lib/sysconfig.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index a11a412475..2ae761cad1 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -73,6 +73,15 @@ _INSTALL_SCHEMES = { 'scripts': '{userbase}/bin', 'data' : '{userbase}', }, + 'osx_framework_user': { + 'stdlib': '{userbase}/lib/python', + 'platstdlib': '{userbase}/lib/python', + 'purelib': '{userbase}/lib/python/site-packages', + 'platlib': '{userbase}/lib/python/site-packages', + 'include': '{userbase}/include', + 'scripts': '{userbase}/bin', + 'data' : '{userbase}', + }, } _SCHEME_KEYS = ('stdlib', 'platstdlib', 'purelib', 'platlib', 'include', @@ -157,6 +166,12 @@ def _getuserbase(): base = os.environ.get("APPDATA") or "~" return env_base if env_base else joinuser(base, "Python") + if sys.platform == "darwin": + framework = get_config_var("PYTHONFRAMEWORK") + if framework: + return joinuser("~", "Library", framework, "%d.%d"%( + sys.version_info[:2])) + return env_base if env_base else joinuser("~", ".local") @@ -398,7 +413,6 @@ def get_config_vars(*args): _CONFIG_VARS['py_version_nodot'] = _PY_VERSION[0] + _PY_VERSION[2] _CONFIG_VARS['base'] = _PREFIX _CONFIG_VARS['platbase'] = _EXEC_PREFIX - _CONFIG_VARS['userbase'] = _getuserbase() _CONFIG_VARS['projectbase'] = _PROJECT_BASE if os.name in ('nt', 'os2'): @@ -406,6 +420,11 @@ def get_config_vars(*args): if os.name == 'posix': _init_posix(_CONFIG_VARS) + # Setting 'userbase' is done below the call to the + # init function to enable using 'get_config_var' in + # the init-function. + _CONFIG_VARS['userbase'] = _getuserbase() + if 'srcdir' not in _CONFIG_VARS: _CONFIG_VARS['srcdir'] = _PROJECT_BASE |