Skip to content

Commit

Permalink
fix: when detecting momento version also catch ModuleNotFoundError
Browse files Browse the repository at this point in the history
A user reports that in some environments this code raises a
`ModuleNotFoundError` as opposed to `ImportError`. We modify the
try-except to also catch that error as the user reports this in a
python 3.8 environment.
  • Loading branch information
malandis committed Sep 18, 2024
1 parent 7a59011 commit c478e8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/momento/internal/_utilities/_momento_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import importlib_metadata

momento_version = importlib_metadata.Distribution.from_name("momento").version # type: ignore[no-untyped-call,misc]
except ImportError:
except (ImportError, ModuleNotFoundError):
# For python >= 3.8
from importlib.metadata import version # type: ignore[import]

Expand Down

0 comments on commit c478e8e

Please sign in to comment.