cpython: c88606bd5287 (original) (raw)
--- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -223,7 +223,19 @@ class HelperFunctionsTests(unittest.Test self.assertEqual(len(dirs), 1) wanted = os.path.join('xoxo', 'Lib', 'site-packages') self.assertEqual(dirs[0], wanted)
elif (sys.platform == "darwin" and[](#l1.7)
sysconfig.get_config_var("PYTHONFRAMEWORK")):[](#l1.8)
# OS X framework builds[](#l1.9)
site.PREFIXES = ['Python.framework'][](#l1.10)
dirs = site.getsitepackages()[](#l1.11)
self.assertEqual(len(dirs), 3)[](#l1.12)
wanted = os.path.join('/Library',[](#l1.13)
sysconfig.get_config_var("PYTHONFRAMEWORK"),[](#l1.14)
sys.version[:3],[](#l1.15)
'site-packages')[](#l1.16)
self.assertEqual(dirs[2], wanted)[](#l1.17) elif os.sep == '/':[](#l1.18)
# OS X non-framwework builds, Linux, FreeBSD, etc[](#l1.19) self.assertEqual(len(dirs), 2)[](#l1.20) wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],[](#l1.21) 'site-packages')[](#l1.22)
@@ -231,21 +243,12 @@ class HelperFunctionsTests(unittest.Test wanted = os.path.join('xoxo', 'lib', 'site-python') self.assertEqual(dirs[1], wanted) else:
# other platforms[](#l1.27) self.assertEqual(len(dirs), 2)[](#l1.28) self.assertEqual(dirs[0], 'xoxo')[](#l1.29) wanted = os.path.join('xoxo', 'lib', 'site-packages')[](#l1.30) self.assertEqual(dirs[1], wanted)[](#l1.31)
# let's try the specific Apple location[](#l1.33)
if (sys.platform == "darwin" and[](#l1.34)
sysconfig.get_config_var("PYTHONFRAMEWORK")):[](#l1.35)
site.PREFIXES = ['Python.framework'][](#l1.36)
dirs = site.getsitepackages()[](#l1.37)
self.assertEqual(len(dirs), 3)[](#l1.38)
wanted = os.path.join('/Library', 'Python', sys.version[:3],[](#l1.39)
'site-packages')[](#l1.40)
self.assertEqual(dirs[2], wanted)[](#l1.41)
- class PthFile(object): """Helper class for handling testing of .pth files"""
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -466,6 +466,8 @@ Core and Builtins Library ------- +- Issue #10881: Fix test_site failure with OS X framework builds. +