Skip to content

Commit e7f1f1d

Browse files
committed
Fix version unknow
1 parent 86ab4a0 commit e7f1f1d

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/HwCodecDetect/run_tests.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -633,13 +633,11 @@ def main():
633633
)
634634

635635
try:
636-
import version
637-
version_str = version.__version__
638-
except ImportError:
636+
from importlib.metadata import version
637+
version_str = version("HwCodecDetect")
638+
except Exception:
639639
try:
640-
version_file_path = get_resource_path("VERSION")
641-
with open(version_file_path, "r", encoding="utf-8") as f:
642-
version_str = f.read().strip()
640+
from . import __version__ as version_str
643641
except Exception:
644642
version_str = "Unknown"
645643

0 commit comments

Comments
 (0)