From 901c6228fb29f843f9a915ae3fcbcb7a463c6eab Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Wed, 18 Sep 2024 13:52:02 +0100 Subject: [PATCH] relative import for version and use PackageNotFoundError --- glass/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/glass/__init__.py b/glass/__init__.py index 8564d440..4f06d29b 100644 --- a/glass/__init__.py +++ b/glass/__init__.py @@ -1,6 +1,8 @@ +from importlib.metadata import PackageNotFoundError + try: - from glass._version import __version__, __version_tuple__ -except ModuleNotFoundError: + from ._version import __version__, __version_tuple__ +except PackageNotFoundError: pass from glass.fields import (