Skip to content

Commit

Permalink
Fix import order to work with mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaFicarelli committed Oct 19, 2023
1 parent 6823a12 commit 5fd5f44
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/build/_importlib.py
@@ -1,13 +1,15 @@
import sys


if sys.version_info >= (3, 10, 2):
from importlib import metadata # type: ignore[attr-defined]
if sys.version_info < (3, 8):
import importlib_metadata as metadata
elif sys.version_info >= (3, 10, 2):
from importlib import metadata
else:
try:
import importlib_metadata as metadata
except ModuleNotFoundError:
# helps bootstrapping when dependencies aren't installed
from importlib import metadata # type: ignore[attr-defined]
from importlib import metadata

__all__ = ['metadata']

0 comments on commit 5fd5f44

Please sign in to comment.