From 43351ff2b53d3c9c5346bd1dd33c4cc527fe54b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=C3=A1n=20Kavanagh?= <51478689+kavanase@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:19:21 -0400 Subject: [PATCH] Fix `python = 3.12` incompatibility (#120) * Update __init__.py * Update __init__.py * Linting update --------- Co-authored-by: Patrick Huck --- src/pyrho/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/pyrho/__init__.py b/src/pyrho/__init__.py index 80dce69..717dd05 100644 --- a/src/pyrho/__init__.py +++ b/src/pyrho/__init__.py @@ -3,10 +3,9 @@ __author__ = """Jimmy Shen""" __email__ = "jmmshn@gmail.com" - -from pkg_resources import DistributionNotFound, get_distribution +from importlib.metadata import PackageNotFoundError, version try: - __version__ = get_distribution(__name__).version -except DistributionNotFound: - pass + __version__ = version(__name__) +except PackageNotFoundError: + __version__ = "unknown"