From: Éric Araujo Date: Mon, 3 Jan 2011 17:51:11 +0000 (+0000) Subject: Fix test_site for systems without unsetenv. Reported by Zsolt Cserna. X-Git-Tag: v3.2rc1~222 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=63ebe1c3093bd40ea5a7e1a225ea0355f13563b4;p=thirdparty%2FPython%2Fcpython.git Fix test_site for systems without unsetenv. Reported by Zsolt Cserna. --- diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index 9b31a3945c56..8168d7ed9295 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -161,12 +161,16 @@ class HelperFunctionsTests(unittest.TestCase): usersite = site.USER_SITE self.assertIn(usersite, sys.path) + env = os.environ.copy() rc = subprocess.call([sys.executable, '-c', - 'import sys; sys.exit(%r in sys.path)' % usersite]) + 'import sys; sys.exit(%r in sys.path)' % usersite], + env=env) self.assertEqual(rc, 1) + env = os.environ.copy() rc = subprocess.call([sys.executable, '-s', '-c', - 'import sys; sys.exit(%r in sys.path)' % usersite]) + 'import sys; sys.exit(%r in sys.path)' % usersite], + env=env) self.assertEqual(rc, 0) env = os.environ.copy()