We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 288f527 commit c33b908Copy full SHA for c33b908
1 file changed
Lib/test/test_wave.py
@@ -2,6 +2,7 @@
2
from test import audiotests
3
from test import support
4
from test.support import os_helper
5
+import contextlib
6
import io
7
import struct
8
import sys
@@ -200,11 +201,9 @@ def test_read_wrong_sample_width(self):
200
201
def test_write_to_protected_location(self):
202
# gh-136523: Wave_write.__del__ should not throw
203
with support.catch_unraisable_exception() as cm:
- try:
204
+ with contextlib.suppress(OSError):
205
with os_helper.temp_dir() as path:
206
wave.open(path, "wb")
- except IsADirectoryError:
207
- pass
208
support.gc_collect()
209
self.assertIsNone(cm.unraisable)
210
0 commit comments