Skip to content

Commit

Permalink
mypy [no-any-return] error
Browse files Browse the repository at this point in the history
  • Loading branch information
dhimmel committed Jul 20, 2024
1 parent ffd8310 commit ff97d7d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions obonet/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

from importlib.metadata import PackageNotFoundError, version

from .read import read_obo

__all__ = [
Expand All @@ -8,10 +10,11 @@


def _get_version() -> str | None:
from importlib.metadata import PackageNotFoundError, version

try:
return version("obonet")
version_ = version("obonet")
# encountered mypy error [no-any-return] on Python 3.11
assert isinstance(version_, str)
return version_
except PackageNotFoundError:
return None

Expand Down

0 comments on commit ff97d7d

Please sign in to comment.