]> granicus.if.org Git - python/commitdiff
When on MacOSX, and only in a framework build, add
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 16 Apr 2003 13:12:21 +0000 (13:12 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 16 Apr 2003 13:12:21 +0000 (13:12 +0000)
~/Library/Python/2.3/site-packages to sys.path, if it exists.

Lib/site.py

index d74609a99c7bd79b85fb74de4d831d463bc43c0e..e862fc2133a5fb3c5a5918a1720bd664f4906693 100644 (file)
@@ -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)