Skip to content

Commit

Permalink
Fix version retrieval from package name
Browse files Browse the repository at this point in the history
  • Loading branch information
bittremieux committed May 18, 2021
1 parent 8edffc7 commit 4b030d2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions falcon/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
pkg_name = 'falcon-ms'

try:
from importlib.metadata import version, PackageNotFoundError

try:
__version__ = version(__name__)
__version__ = version(pkg_name)
except PackageNotFoundError:
pass
except ImportError:
from pkg_resources import get_distribution, DistributionNotFound

try:
__version__ = get_distribution(__name__).version
__version__ = get_distribution(pkg_name).version
except DistributionNotFound:
pass

0 comments on commit 4b030d2

Please sign in to comment.