Update utils.py

This commit is contained in:
Julien Constant 2023-04-15 14:56:13 +02:00
parent 56f93e7b9e
commit 4ca08b3aa3

View File

@ -36,12 +36,11 @@ def get_git_revision_short_hash() -> str:
Return the short hash of the current commit Return the short hash of the current commit
""" """
try: try:
return ( output = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"])
subprocess.check_output(["git", "rev-parse", "--short", "HEAD"]) if isinstance(output, bytes):
.decode("ascii") return output.decode("ascii").strip()
.strip() return output.strip()
) except subprocess.CalledProcessError:
except:
return "" return ""