]> granicus.if.org Git - python/commitdiff
Ensure that test_site actually passes with a framework build
authorRonald Oussoren <ronaldoussoren@mac.com>
Sun, 1 Aug 2010 09:02:50 +0000 (09:02 +0000)
committerRonald Oussoren <ronaldoussoren@mac.com>
Sun, 1 Aug 2010 09:02:50 +0000 (09:02 +0000)
Lib/site.py
Lib/sysconfig.py
Lib/test/test_site.py

index 4624bf310568f80baf30236bf6603b37463e7b5e..29449343f0617d068b787dde0f28d2c8782d92b1 100644 (file)
@@ -295,7 +295,7 @@ def getsitepackages():
             # locations.
             from sysconfig import get_config_var
             framework = get_config_var("PYTHONFRAMEWORK")
-            if framework and "/%s.framework/"%(framework,) in prefix:
+            if framework:
                 sitepackages.append(
                         os.path.join("/Library", framework,
                             sys.version[:3], "site-packages"))
index 2fec9102bc6fdd2df87a3d06d1ea0afef0f23f36..147bd6d4fc2740deae05ca937aa7e5dc2ff95f7a 100644 (file)
@@ -173,7 +173,7 @@ def _getuserbase():
     if sys.platform == "darwin":
         framework = get_config_var("PYTHONFRAMEWORK")
         if framework:
-            return joinuser("~", "Library", framework, "%d.%d"%(
+            return env_base if env_base else joinuser("~", "Library", framework, "%d.%d"%(
                 sys.version_info[:2]))
 
     return env_base if env_base else joinuser("~", ".local")
index 5695cd734d5b598300cfff9a627e83c9925c39ff..37ec61adbb068ca66650181078f7e05d1a9042d8 100644 (file)
@@ -185,13 +185,10 @@ class HelperFunctionsTests(unittest.TestCase):
             sysconfig.get_config_var("PYTHONFRAMEWORK")):
             site.PREFIXES = ['Python.framework']
             dirs = site.getsitepackages()
-            self.assertEqual(len(dirs), 4)
-            wanted = os.path.join('~', 'Library', 'Python',
-                                  sys.version[:3], 'site-packages')
-            self.assertEquals(dirs[2], os.path.expanduser(wanted))
+            self.assertEqual(len(dirs), 3)
             wanted = os.path.join('/Library', 'Python', sys.version[:3],
                                   'site-packages')
-            self.assertEquals(dirs[3], wanted)
+            self.assertEquals(dirs[2], wanted)
 
 class PthFile(object):
     """Helper class for handling testing of .pth files"""