Skip to content

Commit 1bac563

Browse files
committed
Fix test_io_threading to run on Python 3.6.
1 parent adf7667 commit 1bac563

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_io_threading.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import random
1919
import threading
2020
from concurrent.futures import ThreadPoolExecutor
21-
from contextlib import nullcontext
2221
from functools import lru_cache
2322
from io import BytesIO
2423

@@ -28,6 +27,11 @@
2827
from pedalboard import Resample
2928
from pedalboard.io import AudioFile
3029

30+
try:
31+
from contextlib import nullcontext
32+
except ImportError:
33+
from contextlib import suppress as nullcontext
34+
3135
# The number of iterations to run the test for with and
3236
# without a lock around each call to AudioFile's methods:
3337
MAX_ITERATIONS = {"lock": 10, "no lock": 100_000}

0 commit comments

Comments
 (0)