summaryrefslogtreecommitdiff
path: root/Lib/test/test_io.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-06-12 23:57:11 +0200
committerGitHub <noreply@github.com>2019-06-12 23:57:11 +0200
commit913fa1c8245d1cde6edb4254f4fb965cc91786ef (patch)
treed7d046fbad65a7e268c228fe548b2f669d72b0f0 /Lib/test/test_io.py
parent0d1942774a70d561dbaaa980742dd0927e8aa51a (diff)
downloadcpython-git-913fa1c8245d1cde6edb4254f4fb965cc91786ef.tar.gz
bpo-37223, test_io: silence last 'Exception ignored in:' (GH-14029)
Use catch_unraisable_exception() to ignore 'Exception ignored in:' error when the internal BufferedWriter of the BufferedRWPair is destroyed. The C implementation doesn't give access to the internal BufferedWriter, so just ignore the warning instead.
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r--Lib/test/test_io.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 102679b1d3..55686d7439 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -2070,6 +2070,11 @@ class BufferedRWPairTest(unittest.TestCase):
# Silence destructor error
writer.close = lambda: None
+ writer = None
+
+ with support.catch_unraisable_exception():
+ pair = None
+ support.gc_collect()
def test_reader_writer_close_error_on_close(self):
def reader_close():