Issue #7092: Fix the DeprecationWarnings emitted by the standard library

when using the -3 flag.  Patch by Florent Xicluna.
This commit is contained in:
Antoine Pitrou 2010-01-04 23:22:44 +00:00
parent b9c3ed4f82
commit b9d4963a98
18 changed files with 99 additions and 88 deletions

View file

@ -746,9 +746,15 @@ class TestCase(object):
# not hashable.
expected = list(expected_seq)
actual = list(actual_seq)
expected.sort()
actual.sort()
missing, unexpected = util.sorted_list_difference(expected, actual)
with warnings.catch_warnings():
if sys.py3kwarning:
# Silence Py3k warning
warnings.filterwarnings("ignore",
"dict inequality comparisons "
"not supported", DeprecationWarning)
expected.sort()
actual.sort()
missing, unexpected = util.sorted_list_difference(expected, actual)
errors = []
if missing:
errors.append('Expected, but missing:\n %r' % missing)