]> granicus.if.org Git - python/commitdiff
Fix accidental name rebinding in unittest py3k warning filtering.
authorMichael Foord <fuzzyman@voidspace.org.uk>
Sun, 7 Mar 2010 23:10:36 +0000 (23:10 +0000)
committerMichael Foord <fuzzyman@voidspace.org.uk>
Sun, 7 Mar 2010 23:10:36 +0000 (23:10 +0000)
Lib/unittest/case.py

index 0bfcc757acff3acf9e007c003ae14a783c53a1f4..f5dc87baf4cad7442aaf6e4deec8cbb7af780414 100644 (file)
@@ -798,10 +798,10 @@ class TestCase(object):
         with warnings.catch_warnings():
             if sys.py3kwarning:
                 # Silence Py3k warning raised during the sorting
-                for msg in ["dict inequality comparisons",
+                for _msg in ["dict inequality comparisons",
                             "builtin_function_or_method order comparisons",
                             "comparing unequal types"]:
-                    warnings.filterwarnings("ignore", msg, DeprecationWarning)
+                    warnings.filterwarnings("ignore", _msg, DeprecationWarning)
             try:
                 expected = set(expected_seq)
                 actual = set(actual_seq)
@@ -820,6 +820,7 @@ class TestCase(object):
         if unexpected:
             errors.append('Unexpected, but present:\n    %s' %
                           safe_repr(unexpected))
+        print 'errors', errors
         if errors:
             standardMsg = '\n'.join(errors)
             self.fail(self._formatMessage(msg, standardMsg))