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 adf7667 commit 1bac563Copy full SHA for 1bac563
tests/test_io_threading.py
@@ -18,7 +18,6 @@
18
import random
19
import threading
20
from concurrent.futures import ThreadPoolExecutor
21
-from contextlib import nullcontext
22
from functools import lru_cache
23
from io import BytesIO
24
@@ -28,6 +27,11 @@
28
27
from pedalboard import Resample
29
from pedalboard.io import AudioFile
30
+try:
31
+ from contextlib import nullcontext
32
+except ImportError:
33
+ from contextlib import suppress as nullcontext
34
+
35
# The number of iterations to run the test for with and
36
# without a lock around each call to AudioFile's methods:
37
MAX_ITERATIONS = {"lock": 10, "no lock": 100_000}
0 commit comments