From 6413a187d1c3f3df21c12cb94e7ccea988913bc3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 21 Aug 2024 10:48:50 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=8E=E2=80=8D=E2=99=80=EF=B8=8F=20Genuf?= =?UTF-8?q?lect=20to=20the=20types.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backports/__init__.py | 2 +- backports/entry_points_selectable.py | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/backports/__init__.py b/backports/__init__.py index 0d1f7ed..69e3be5 100644 --- a/backports/__init__.py +++ b/backports/__init__.py @@ -1 +1 @@ -__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/backports/entry_points_selectable.py b/backports/entry_points_selectable.py index f459f53..6b3f621 100644 --- a/backports/entry_points_selectable.py +++ b/backports/entry_points_selectable.py @@ -21,24 +21,27 @@ import functools try: - from itertools import filterfalse # type: ignore + from itertools import filterfalse except ImportError: - from itertools import ifilterfalse as filterfalse # type: ignore + from itertools import ifilterfalse as filterfalse # type: ignore[attr-defined, no-redef] try: # prefer importlib_metadata if it has EntryPoints - import importlib_metadata as metadata # type: ignore + import importlib_metadata as metadata if not hasattr(metadata, 'EntryPoints'): raise ImportError("package without EntryPoints") - from importlib_metadata import distributions, EntryPoint # type: ignore + from importlib_metadata import distributions, EntryPoint except ImportError: try: - import importlib.metadata as metadata # type: ignore - from importlib.metadata import distributions, EntryPoint # type: ignore + import importlib.metadata as metadata + from importlib.metadata import distributions, EntryPoint except ImportError: - from importlib_metadata import distributions, EntryPoint # type: ignore + from importlib_metadata import ( # type: ignore[import-not-found] + distributions, + EntryPoint, + ) __all__ = ['entry_points']