From: Antoine Pitrou Date: Wed, 23 Oct 2013 20:03:22 +0000 (+0200) Subject: Issue #19360: fix test_site when Python is installed into $HOME/.local X-Git-Tag: v3.3.3rc1~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a1782e1be87bc6cffbf5e1b4e74e1b2456d087d4;p=thirdparty%2FPython%2Fcpython.git Issue #19360: fix test_site when Python is installed into $HOME/.local --- diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index 16081a1e1eb8..db94b7b2a70f 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -179,14 +179,20 @@ class HelperFunctionsTests(unittest.TestCase): rc = subprocess.call([sys.executable, '-s', '-c', 'import sys; sys.exit(%r in sys.path)' % usersite], env=env) - self.assertEqual(rc, 0) + if usersite == site.getsitepackages()[0]: + self.assertEqual(rc, 1) + else: + self.assertEqual(rc, 0) env = os.environ.copy() env["PYTHONNOUSERSITE"] = "1" rc = subprocess.call([sys.executable, '-c', 'import sys; sys.exit(%r in sys.path)' % usersite], env=env) - self.assertEqual(rc, 0) + if usersite == site.getsitepackages()[0]: + self.assertEqual(rc, 1) + else: + self.assertEqual(rc, 0) env = os.environ.copy() env["PYTHONUSERBASE"] = "/tmp"