Kaydet (Commit) bda4672b authored tarafından Ronald Oussoren's avatar Ronald Oussoren

Ensure that test_site actually passes with a framework build

üst 794f5b35
...@@ -295,7 +295,7 @@ def getsitepackages(): ...@@ -295,7 +295,7 @@ def getsitepackages():
# locations. # locations.
from sysconfig import get_config_var from sysconfig import get_config_var
framework = get_config_var("PYTHONFRAMEWORK") framework = get_config_var("PYTHONFRAMEWORK")
if framework and "/%s.framework/"%(framework,) in prefix: if framework:
sitepackages.append( sitepackages.append(
os.path.join("/Library", framework, os.path.join("/Library", framework,
sys.version[:3], "site-packages")) sys.version[:3], "site-packages"))
......
...@@ -173,7 +173,7 @@ def _getuserbase(): ...@@ -173,7 +173,7 @@ def _getuserbase():
if sys.platform == "darwin": if sys.platform == "darwin":
framework = get_config_var("PYTHONFRAMEWORK") framework = get_config_var("PYTHONFRAMEWORK")
if framework: if framework:
return joinuser("~", "Library", framework, "%d.%d"%( return env_base if env_base else joinuser("~", "Library", framework, "%d.%d"%(
sys.version_info[:2])) sys.version_info[:2]))
return env_base if env_base else joinuser("~", ".local") return env_base if env_base else joinuser("~", ".local")
......
...@@ -185,13 +185,10 @@ class HelperFunctionsTests(unittest.TestCase): ...@@ -185,13 +185,10 @@ class HelperFunctionsTests(unittest.TestCase):
sysconfig.get_config_var("PYTHONFRAMEWORK")): sysconfig.get_config_var("PYTHONFRAMEWORK")):
site.PREFIXES = ['Python.framework'] site.PREFIXES = ['Python.framework']
dirs = site.getsitepackages() dirs = site.getsitepackages()
self.assertEqual(len(dirs), 4) self.assertEqual(len(dirs), 3)
wanted = os.path.join('~', 'Library', 'Python',
sys.version[:3], 'site-packages')
self.assertEquals(dirs[2], os.path.expanduser(wanted))
wanted = os.path.join('/Library', 'Python', sys.version[:3], wanted = os.path.join('/Library', 'Python', sys.version[:3],
'site-packages') 'site-packages')
self.assertEquals(dirs[3], wanted) self.assertEquals(dirs[2], wanted)
class PthFile(object): class PthFile(object):
"""Helper class for handling testing of .pth files""" """Helper class for handling testing of .pth files"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment