[Python-checkins] cpython: Fix test_site from modifying sysconfig._CONFIG_VARS.
brett.cannon
python-checkins at python.org
Fri Apr 6 18:55:29 CEST 2012
http://hg.python.org/cpython/rev/1a3eb3b8ba42
changeset: 76138:1a3eb3b8ba42
parent: 76082:d0e4e3ef224e
user: Brett Cannon <brett at python.org>
date: Wed Apr 04 17:31:16 2012 -0400
summary:
Fix test_site from modifying sysconfig._CONFIG_VARS.
files:
Lib/test/test_site.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -39,6 +39,7 @@
self.old_base = site.USER_BASE
self.old_site = site.USER_SITE
self.old_prefixes = site.PREFIXES
+ self.original_vars = sysconfig._CONFIG_VARS
self.old_vars = copy(sysconfig._CONFIG_VARS)
def tearDown(self):
@@ -47,7 +48,9 @@
site.USER_BASE = self.old_base
site.USER_SITE = self.old_site
site.PREFIXES = self.old_prefixes
- sysconfig._CONFIG_VARS = self.old_vars
+ sysconfig._CONFIG_VARS = self.original_vars
+ sysconfig._CONFIG_VARS.clear()
+ sysconfig._CONFIG_VARS.update(self.old_vars)
def test_makepath(self):
# Test makepath() have an absolute path for its first return value
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list