[Python-checkins] cpython (3.2): Fix "sys.path modified" warning in test_strlit, by not replacing sys.path

georg.brandl python-checkins at python.org
Mon Feb 20 21:41:44 CET 2012


http://hg.python.org/cpython/rev/b89cff9c63be
changeset:   75076:b89cff9c63be
branch:      3.2
user:        Georg Brandl <georg at python.org>
date:        Mon Feb 20 21:36:28 2012 +0100
summary:
  Fix "sys.path modified" warning in test_strlit, by not replacing sys.path itself, only its contents.

files:
  Lib/test/test_strlit.py |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_strlit.py b/Lib/test/test_strlit.py
--- a/Lib/test/test_strlit.py
+++ b/Lib/test/test_strlit.py
@@ -65,7 +65,7 @@
         sys.path.insert(0, self.tmpdir)
 
     def tearDown(self):
-        sys.path = self.save_path
+        sys.path[:] = self.save_path
         shutil.rmtree(self.tmpdir, ignore_errors=True)
 
     def test_template(self):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list