mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Issue #7092: Fix the DeprecationWarnings emitted by the standard library
when using the -3 flag. Patch by Florent Xicluna.
This commit is contained in:
parent
b9c3ed4f82
commit
b9d4963a98
18 changed files with 99 additions and 88 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue