diff --git a/libkeyringctl/keyring.py b/libkeyringctl/keyring.py index 3690877..3deecbc 100644 --- a/libkeyringctl/keyring.py +++ b/libkeyringctl/keyring.py @@ -1,16 +1,22 @@ # SPDX-License-Identifier: GPL-3.0-or-later from collections import defaultdict -from collections.abc import Iterable from itertools import chain from logging import debug from logging import error from pathlib import Path +from platform import python_version_tuple from re import match from shutil import copytree from tempfile import NamedTemporaryFile from tempfile import mkdtemp from typing import Dict + +# NOTE: remove after python 3.8.x is no longer supported upstream +if int(python_version_tuple()[1]) < 9: # pragma: no cover + from typing import Iterable +else: + from collections.abc import Iterable from typing import List from typing import Optional from typing import Set diff --git a/libkeyringctl/sequoia.py b/libkeyringctl/sequoia.py index 4b1bc12..8eb368c 100644 --- a/libkeyringctl/sequoia.py +++ b/libkeyringctl/sequoia.py @@ -1,12 +1,18 @@ # SPDX-License-Identifier: GPL-3.0-or-later -from collections.abc import Iterable from datetime import datetime from functools import reduce from pathlib import Path +from platform import python_version_tuple from re import sub from tempfile import mkdtemp from typing import Dict + +# NOTE: remove after python 3.8.x is no longer supported upstream +if int(python_version_tuple()[1]) < 9: # pragma: no cover + from typing import Iterable +else: + from collections.abc import Iterable from typing import List from typing import Optional diff --git a/libkeyringctl/util.py b/libkeyringctl/util.py index 41a6152..4ecdd1f 100644 --- a/libkeyringctl/util.py +++ b/libkeyringctl/util.py @@ -1,12 +1,11 @@ # SPDX-License-Identifier: GPL-3.0-or-later -from collections.abc import Iterable -from collections.abc import Iterator from contextlib import contextmanager from hashlib import sha256 from os import chdir from os import environ from os import getcwd from pathlib import Path +from platform import python_version_tuple from re import escape from re import split from re import sub @@ -22,6 +21,14 @@ from traceback import print_stack from typing import IO from typing import AnyStr from typing import Dict + +# NOTE: remove after python 3.8.x is no longer supported upstream +if int(python_version_tuple()[1]) < 9: # pragma: no cover + from typing import Iterable + from typing import Iterator +else: + from collections.abc import Iterable + from collections.abc import Iterator from typing import List from typing import Optional from typing import Set