diff --git a/barcode/codex.py b/barcode/codex.py index 0eda13a..f296855 100755 --- a/barcode/codex.py +++ b/barcode/codex.py @@ -6,7 +6,6 @@ from __future__ import annotations from typing import TYPE_CHECKING -from typing import Collection from typing import Literal from barcode.base import Barcode @@ -17,6 +16,8 @@ from barcode.errors import NumberOfDigitsError if TYPE_CHECKING: + from collections.abc import Collection + from barcode.writer import BaseWriter __docformat__ = "restructuredtext en" diff --git a/barcode/writer.py b/barcode/writer.py index 77c5c8d..9f64835 100755 --- a/barcode/writer.py +++ b/barcode/writer.py @@ -11,7 +11,7 @@ from barcode.version import version if TYPE_CHECKING: - from typing import Generator + from collections.abc import Generator from typing import Literal from PIL.Image import Image as T_Image diff --git a/tests/test_manually.py b/tests/test_manually.py index 12f4d15..802fb03 100755 --- a/tests/test_manually.py +++ b/tests/test_manually.py @@ -4,7 +4,7 @@ import codecs import os -from typing import Iterator +from typing import TYPE_CHECKING import pytest @@ -13,6 +13,9 @@ from barcode import version from barcode.writer import ImageWriter +if TYPE_CHECKING: + from collections.abc import Iterator + PATH = os.path.dirname(os.path.abspath(__file__)) TESTPATH = os.path.join(PATH, "test_outputs") HTMLFILE = os.path.join(TESTPATH, "index.html")