Skip to content

Commit

Permalink
feat(utils): add utils._compat module, add importlib metadata
Browse files Browse the repository at this point in the history
Signed-off-by: Braden Mars <bradenmars@bradenmars.me>
  • Loading branch information
BradenM committed Jan 30, 2023
1 parent ac1356d commit 5722504
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions micropy/utils/_compat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from __future__ import annotations

try:
from importlib import metadata as _metadata
except ImportError:
# compat for py <3.10
import importlib_metadata as metadata
else:
# workaround for
# https://github.com/python/mypy/issues/1393
metadata = _metadata

__all__ = ["metadata"]

0 comments on commit 5722504

Please sign in to comment.