From fee2a8b3521b7d637cbfbe09223a1404e77e1d20 Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 6 Feb 2025 20:22:56 +0100 Subject: [PATCH] typing: Update deprecated types --- converter.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/converter.py b/converter.py index 891075f..8f2c023 100755 --- a/converter.py +++ b/converter.py @@ -23,6 +23,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ''' import argparse +import collections import filecmp # diff import os import queue @@ -153,11 +154,11 @@ class Stats: # Main converter class. Thread safe. class Converter: - def __init__(self, outstreamFunction: typing.Callable[[str], None]) -> None: + def __init__(self, outstreamFunction: collections.abc.Callable[[str], None]) -> None: self._running: bool = False self._stopSignal: bool = False self._runLock: threading.Lock = threading.Lock() - self._outstreamFunction: typing.Callable[[str], None] = outstreamFunction + self._outstreamFunction: collections.abc.Callable[[str], None] = outstreamFunction self._logLock: threading.Lock = threading.Lock() self._statsLock: threading.Lock = threading.Lock() @@ -571,12 +572,11 @@ class Converter: if not node.tag.endswith("trackList"): continue - # Each element is a string path. for track in node: # in . if not track.tag.endswith("track"): continue - element: typing.Optional[xml.etree.ElementTree.Element] = track.find("{" + xmlns + "}location") + element: xml.etree.ElementTree.Element | None = track.find("{" + xmlns + "}location") if element is None: continue -- 2.47.3