From 1579700571235879933d7db12eb019d7a5425b6d Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Tue, 25 Jun 2024 00:25:04 +0800 Subject: [PATCH] fix version for python < 3.11 --- stack_orchestrator/version.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stack_orchestrator/version.py b/stack_orchestrator/version.py index a37cc0b6..c1e72bb3 100644 --- a/stack_orchestrator/version.py +++ b/stack_orchestrator/version.py @@ -24,9 +24,9 @@ def command(ctx): # See: https://stackoverflow.com/a/20885799/1701505 from stack_orchestrator import data - tag_file_path = resources.files(data) / "build_tag.txt" - if tag_file_path.exists(): - with open(tag_file_path, "r") as version_file: + # tag_file_path = resources.files(data) / + if resources.is_resource(data, "build_tag.txt"): + with resources.open_text(data, "build_tag.txt") as version_file: # TODO: code better version that skips comment lines version_string = version_file.read().splitlines()[1] else: