summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_io.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-06-14 16:03:22 (GMT)
committerGitHub <noreply@github.com>2019-06-14 16:03:22 (GMT)
commit212646cae6b7c4ddc8d98c8b9b6d39a5f259e864 (patch)
treebb98370389d304b2b835efd3791fcbbab07bb320 /Lib/test/test_io.py
parent9765efcb39fc03d5b1abec3924388974470a8bd5 (diff)
downloadcpython-212646cae6b7c4ddc8d98c8b9b6d39a5f259e864.zip
cpython-212646cae6b7c4ddc8d98c8b9b6d39a5f259e864.tar.gz
cpython-212646cae6b7c4ddc8d98c8b9b6d39a5f259e864.tar.bz2
bpo-37261: Document sys.unraisablehook corner cases (GH-14059)
Document reference cycle and resurrected objects issues in sys.unraisablehook() and threading.excepthook() documentation. Fix test.support.catch_unraisable_exception(): __exit__() no longer ignores unraisable exceptions. Fix test_io test_writer_close_error_on_close(): use a second catch_unraisable_exception() to catch the BufferedWriter unraisable exception.
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r--Lib/test/test_io.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 55686d7..fc474c9 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -2072,8 +2072,12 @@ class BufferedRWPairTest(unittest.TestCase):
writer.close = lambda: None
writer = None
+ # Ignore BufferedWriter (of the BufferedRWPair) unraisable exception
with support.catch_unraisable_exception():
- pair = None
+ # Ignore BufferedRWPair unraisable exception
+ with support.catch_unraisable_exception():
+ pair = None
+ support.gc_collect()
support.gc_collect()
def test_reader_writer_close_error_on_close(self):