mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
When on MacOSX, and only in a framework build, add
~/Library/Python/2.3/site-packages to sys.path, if it exists.
This commit is contained in:
parent
36d49a907f
commit
be5d707926
1 changed files with 13 additions and 0 deletions
13
Lib/site.py
13
Lib/site.py
|
@ -172,6 +172,19 @@ for prefix in prefixes:
|
||||||
os.path.join(prefix, "lib", "site-python")]
|
os.path.join(prefix, "lib", "site-python")]
|
||||||
else:
|
else:
|
||||||
sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")]
|
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:
|
for sitedir in sitedirs:
|
||||||
if os.path.isdir(sitedir):
|
if os.path.isdir(sitedir):
|
||||||
addsitedir(sitedir)
|
addsitedir(sitedir)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue