diff --git a/beets/util/pipeline.py b/beets/util/pipeline.py index bf856eb55..c4933ff00 100644 --- a/beets/util/pipeline.py +++ b/beets/util/pipeline.py @@ -35,7 +35,6 @@ in place of any single coroutine. import queue import sys from threading import Lock, Thread -from typing import TypeVar BUBBLE = "__PIPELINE_BUBBLE__" POISON = "__PIPELINE_POISON__" @@ -85,10 +84,7 @@ def _invalidate_queue(q, val=None, sync=True): q.mutex.release() -T = TypeVar("T") - - -class CountedQueue(queue.Queue[T]): +class CountedQueue(queue.Queue): """A queue that keeps track of the number of threads that are still feeding into it. The queue is poisoned when all threads are finished with the queue. diff --git a/beetsplug/replaygain.py b/beetsplug/replaygain.py index 583555530..e0e129540 100644 --- a/beetsplug/replaygain.py +++ b/beetsplug/replaygain.py @@ -1181,9 +1181,7 @@ class ExceptionWatcher(Thread): Once an exception occurs, raise it and execute a callback. """ - def __init__( - self, queue: queue.Queue[Exception], callback: Callable[[], None] - ): + def __init__(self, queue: queue.Queue, callback: Callable[[], None]): self._queue = queue self._callback = callback self._stopevent = Event() @@ -1442,7 +1440,7 @@ class ReplayGainPlugin(BeetsPlugin): """Open a `ThreadPool` instance in `self.pool`""" if self.pool is None and self.backend_instance.do_parallel: self.pool = ThreadPool(threads) - self.exc_queue: queue.Queue[Exception] = queue.Queue() + self.exc_queue: queue.Queue = queue.Queue() signal.signal(signal.SIGINT, self._interrupt)