Replaced deprecated module pkg_resources

Removed in py3.12
This commit is contained in:
Mathis Ribet 2024-10-11 10:15:43 +02:00 committed by Mathis Ribet
parent 8dde35dd31
commit c3d3e6857a
No known key found for this signature in database
GPG key ID: AC210F5420AF42C0

View file

@ -1,6 +1,6 @@
from pkg_resources import DistributionNotFound, get_distribution from importlib.metadata import version as _get_version, PackageNotFoundError
try: try:
__version__ = get_distribution(__name__).version __version__ = _get_version(__name__)
except DistributionNotFound: except PackageNotFoundError:
pass pass