[Python-checkins] r83397 - in python/branches/py3k/Lib: site.py sysconfig.py test/test_site.py

ronald.oussoren python-checkins at python.org
Sun Aug 1 11:02:50 CEST 2010


Author: ronald.oussoren
Date: Sun Aug  1 11:02:50 2010
New Revision: 83397

Log:
Ensure that test_site actually passes with a framework build

Modified:
   python/branches/py3k/Lib/site.py
   python/branches/py3k/Lib/sysconfig.py
   python/branches/py3k/Lib/test/test_site.py

Modified: python/branches/py3k/Lib/site.py
==============================================================================
--- python/branches/py3k/Lib/site.py	(original)
+++ python/branches/py3k/Lib/site.py	Sun Aug  1 11:02:50 2010
@@ -295,7 +295,7 @@
             # 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"))

Modified: python/branches/py3k/Lib/sysconfig.py
==============================================================================
--- python/branches/py3k/Lib/sysconfig.py	(original)
+++ python/branches/py3k/Lib/sysconfig.py	Sun Aug  1 11:02:50 2010
@@ -173,7 +173,7 @@
     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")

Modified: python/branches/py3k/Lib/test/test_site.py
==============================================================================
--- python/branches/py3k/Lib/test/test_site.py	(original)
+++ python/branches/py3k/Lib/test/test_site.py	Sun Aug  1 11:02:50 2010
@@ -185,13 +185,10 @@
             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"""


More information about the Python-checkins mailing list