[Python-checkins] cpython (merge 3.2 -> default): Merge with 3.2.

ezio.melotti python-checkins at python.org
Sun Mar 20 14:35:00 CET 2011


http://hg.python.org/cpython/rev/815e97df82a0
changeset:   68745:815e97df82a0
parent:      68742:dc38c4d65cd9
parent:      68744:5d4800b10acd
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Sun Mar 20 15:34:28 2011 +0200
summary:
  Merge with 3.2.

files:
  Lib/test/regrtest.py

diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -827,7 +827,8 @@
     resources = ('sys.argv', 'cwd', 'sys.stdin', 'sys.stdout', 'sys.stderr',
                  'os.environ', 'sys.path', 'sys.path_hooks', '__import__',
                  'warnings.filters', 'asyncore.socket_map',
-                 'logging._handlers', 'logging._handlerList', 'sys.gettrace')
+                 'logging._handlers', 'logging._handlerList', 'sys.gettrace',
+                 'sys.warnoptions')
 
     def get_sys_argv(self):
         return id(sys.argv), sys.argv, sys.argv[:]
@@ -914,6 +915,12 @@
         # Can't easily revert the logging state
         pass
 
+    def get_sys_warnoptions(self):
+        return id(sys.warnoptions), sys.warnoptions, sys.warnoptions[:]
+    def restore_sys_warnoptions(self, saved_options):
+        sys.warnoptions = saved_options[1]
+        sys.warnoptions[:] = saved_options[2]
+
     def resource_info(self):
         for name in self.resources:
             method_suffix = name.replace('.', '_')
diff --git a/Lib/unittest/test/test_program.py b/Lib/unittest/test/test_program.py
--- a/Lib/unittest/test/test_program.py
+++ b/Lib/unittest/test/test_program.py
@@ -189,7 +189,7 @@
         class FakeTP(unittest.TestProgram):
             def parseArgs(self, *args, **kw): pass
             def runTests(self, *args, **kw): pass
-        warnoptions = sys.warnoptions
+        warnoptions = sys.warnoptions[:]
         try:
             sys.warnoptions[:] = []
             # no warn options, no arg -> default

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


More information about the Python-checkins mailing list