Clean up the warnings filter use in test_set.
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index f4d1f6a..1e0a909 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -907,7 +907,8 @@
class TestBasicOpsMixedStringBytes(TestBasicOps):
def setUp(self):
- self.warning_filters = warnings.filters[:]
+ self._warning_filters = support.check_warnings()
+ self._warning_filters.__enter__()
warnings.simplefilter('ignore', BytesWarning)
self.case = "string and bytes set"
self.values = ["a", "b", b"a", b"b"]
@@ -917,7 +918,7 @@
self.repr = "{'a', b'a', 'b', b'b'}"
def tearDown(self):
- warnings.filters = self.warning_filters
+ self._warning_filters.__exit__(None, None, None)
#==============================================================================