mirror of https://github.com/python/cpython
Fix accidental name rebinding in unittest py3k warning filtering.
This commit is contained in:
parent
5ffa325a82
commit
a715255a27
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue