From c3d3e6857a7ce1c4eb0db9a7878f44d7bd209cd7 Mon Sep 17 00:00:00 2001 From: Mathis Ribet Date: Fri, 11 Oct 2024 10:15:43 +0200 Subject: [PATCH] Replaced deprecated module pkg_resources Removed in py3.12 --- netbox_agent/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/netbox_agent/__init__.py b/netbox_agent/__init__.py index e8fa341..cb47dd4 100644 --- a/netbox_agent/__init__.py +++ b/netbox_agent/__init__.py @@ -1,6 +1,6 @@ -from pkg_resources import DistributionNotFound, get_distribution +from importlib.metadata import version as _get_version, PackageNotFoundError try: - __version__ = get_distribution(__name__).version -except DistributionNotFound: + __version__ = _get_version(__name__) +except PackageNotFoundError: pass