Skip to content

Commit

Permalink
🧎‍♀️ Genuflect to the types.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Aug 21, 2024
1 parent f17579d commit 6413a18
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion backports/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
17 changes: 10 additions & 7 deletions backports/entry_points_selectable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit 6413a18

Please sign in to comment.