diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2003-04-16 13:12:21 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2003-04-16 13:12:21 (GMT) |
commit | be5d707926761c3769700552a8cdfe44c3ca200c (patch) | |
tree | d7a1c157843115c427f1161e1e9527f9d31cb811 /Lib/site.py | |
parent | 36d49a907fdc1dd34ee30b3b407ea9d92e35f4f9 (diff) | |
download | cpython-be5d707926761c3769700552a8cdfe44c3ca200c.zip cpython-be5d707926761c3769700552a8cdfe44c3ca200c.tar.gz cpython-be5d707926761c3769700552a8cdfe44c3ca200c.tar.bz2 |
When on MacOSX, and only in a framework build, add
~/Library/Python/2.3/site-packages to sys.path, if it exists.
Diffstat (limited to 'Lib/site.py')
-rw-r--r-- | Lib/site.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/site.py b/Lib/site.py index d74609a..e862fc2 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -172,6 +172,19 @@ for prefix in prefixes: os.path.join(prefix, "lib", "site-python")] else: sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")] + if sys.platform == 'darwin': + # for framework builds *only* we add the standard Apple + # locations. Currently only per-user, but /Library and + # /Network/Library could be added too + if 'Python.framework' in prefix: + home = os.environ['HOME'] + if home: + sitedirs.append( + os.path.join(home, + 'Library', + 'Python', + sys.version[:3], + 'site-packages')) for sitedir in sitedirs: if os.path.isdir(sitedir): addsitedir(sitedir) |