From 6f837cd50df15f6902ac624af12098c0bff7b1bc Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Fri, 9 Sep 2022 18:48:10 +0200 Subject: [PATCH] Fix crash when you have repository with no tags (like a forked repo) (#343) --- util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.py b/util.py index 7841b3b..75daa77 100644 --- a/util.py +++ b/util.py @@ -457,7 +457,7 @@ def get_snapshot_version(): try: ret = subprocess.check_output(["git", "describe", "--tags"]).strip() ver = ret.decode("utf-8") - except FileNotFoundError: + except (FileNotFoundError, subprocess.CalledProcessError): try: with open(os.path.join(root_dir, ".git/refs/heads/master")) as f: ver = "g" + f.read()[:7]