Skip to content

Commit

Permalink
Deal with deprecated pkg_resources for py3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
richardkiss committed Jun 3, 2023
1 parent 021907c commit 04f38ca
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions pycoin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
from pkg_resources import get_distribution, DistributionNotFound

try:
version = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
version = "unknown"
from importlib.metadata import versionz as get_version

version = get_version(__name__)
except ImportError:
from pkg_resources import get_distribution, DistributionNotFound

try:
version = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
version = "unknown"

__title__ = 'pycoin'
__author__ = 'Richard Kiss'
Expand Down

0 comments on commit 04f38ca

Please sign in to comment.