Skip to content

Commit

Permalink
catch PackageNotFoundError, add blank line
Browse files Browse the repository at this point in the history
  • Loading branch information
LarryMartell authored and uri-rodberg committed Aug 1, 2023
1 parent 6db6851 commit ee94e49
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sorl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
import importlib.metadata as importlib_metadata
__version__ = importlib_metadata.version("sorl-thumbnail")
from importlib.metadata import version, PackageNotFoundError

try:
__version__ = version("sorl-thumbnail")
except PackageNotFoundError:
# package is not installed
pass

0 comments on commit ee94e49

Please sign in to comment.