diff options
author | Éric Araujo <merwok@netwok.org> | 2011-10-08 00:49:12 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-10-08 00:49:12 (GMT) |
commit | 1a1a8a0e31777f8b943b17f5551cac26a5671907 (patch) | |
tree | f1b3ec1a3c774cf4d8d5cf605360117c550c0868 /Lib | |
parent | 5fb16cd1d281c69b443c3c8027a2f03721f2680b (diff) | |
download | cpython-1a1a8a0e31777f8b943b17f5551cac26a5671907.zip cpython-1a1a8a0e31777f8b943b17f5551cac26a5671907.tar.gz cpython-1a1a8a0e31777f8b943b17f5551cac26a5671907.tar.bz2 |
Fix test_sysconfig when prefix != exec-prefix (#9100).
Reported by Zsolt Cserna.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_sysconfig.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py index 57d1f55..716fa5e 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -1,9 +1,5 @@ -"""Tests for 'site'. +"""Tests for sysconfig.""" -Tests assume the initial paths in sys.path once the interpreter has begun -executing have not been removed. - -""" import unittest import sys import os @@ -259,8 +255,15 @@ class TestSysConfig(unittest.TestCase): # is similar to the global posix_prefix one base = get_config_var('base') user = get_config_var('userbase') + # 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 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) user_path = get_path(name, 'posix_user') self.assertEqual(user_path, global_path.replace(base, user, 1)) |