diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2012-05-26 02:45:29 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2012-05-26 02:45:29 (GMT) |
commit | 7ded1f0f694f0f99252ea19eca18b74ea5e36cb0 (patch) | |
tree | 1f07c57fddc9627f3d506b7a8d25ded561f5a2e0 /Lib/test/test_sysconfig.py | |
parent | f2bdc3690a59ca2af3f2fa82f506350874ff1467 (diff) | |
download | cpython-7ded1f0f694f0f99252ea19eca18b74ea5e36cb0.zip cpython-7ded1f0f694f0f99252ea19eca18b74ea5e36cb0.tar.gz cpython-7ded1f0f694f0f99252ea19eca18b74ea5e36cb0.tar.bz2 |
Implemented PEP 405 (Python virtual environments).
Diffstat (limited to 'Lib/test/test_sysconfig.py')
-rw-r--r-- | Lib/test/test_sysconfig.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py index a2e6fbc..e583793 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -260,12 +260,17 @@ class TestSysConfig(unittest.TestCase): # the global scheme mirrors the distinction between prefix and # exec-prefix but not the user scheme, so we have to adapt the paths # before comparing (issue #9100) - adapt = sys.prefix != sys.exec_prefix + adapt = sys.base_prefix != sys.base_exec_prefix for name in ('stdlib', 'platstdlib', 'purelib', 'platlib'): global_path = get_path(name, 'posix_prefix') if adapt: - global_path = global_path.replace(sys.exec_prefix, sys.prefix) - base = base.replace(sys.exec_prefix, sys.prefix) + global_path = global_path.replace(sys.exec_prefix, sys.base_prefix) + base = base.replace(sys.exec_prefix, sys.base_prefix) + elif sys.base_prefix != sys.prefix: + # virtual environment? Likewise, we have to adapt the paths + # before comparing + global_path = global_path.replace(sys.base_prefix, sys.prefix) + base = base.replace(sys.base_prefix, sys.prefix) user_path = get_path(name, 'posix_user') self.assertEqual(user_path, global_path.replace(base, user, 1)) |