aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw-e-w <40751091+w-e-w@users.noreply.github.com>2023-06-03 13:07:07 +0900
committerGitHub <noreply@github.com>2023-06-03 13:07:07 +0900
commitd1bfc86ffcbe64eea7642ed1292ac89199beb0dc (patch)
treebf2c961a516a4ea54c70b70ecb52852264ed6c98
parent0dd6bca4f1a449b7ad9fa77fab0037aa98d21ced (diff)
Update modules/launch_utils.py
Co-authored-by: Aarni Koskela <akx@iki.fi>
-rw-r--r--modules/launch_utils.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/launch_utils.py b/modules/launch_utils.py
index e7dbc5b2..9c3af12f 100644
--- a/modules/launch_utils.py
+++ b/modules/launch_utils.py
@@ -68,8 +68,12 @@ def git_tag():
try:
return subprocess.check_output([git, "describe", "--tags"], shell=False, encoding='utf8').strip()
except Exception:
- with open(os.path.dirname(os.path.abspath(__file__)) + "/../CHANGELOG.md") as file:
- return next((line.strip() for line in file if line.strip()), "<none>")
+ try:
+ changelog_md = pathlib.Path(__file__).parent.parent / "CHANGELOG.md"
+ with changelog_md.open(encoding="utf-8") as file:
+ return next((line.strip() for line in file if line.strip()), "<none>")
+ except Exception:
+ return "<none>"
def run(command, desc=None, errdesc=None, custom_env=None, live: bool = default_command_live) -> str: