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.
This commit is contained in:
Victor Stinner 2019-06-12 23:57:11 +02:00 committed by GitHub
parent 0d1942774a
commit 913fa1c824
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -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():