Handle exception with version (#9376)

This commit is contained in:
Liubov Talamanova 2021-12-22 19:45:08 +03:00 committed by GitHub
parent 529ab2b099
commit 7e85ada7e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ def generate_pot_version():
branch_name = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).strip().decode()
commit_hash = subprocess.check_output(["git", "rev-parse", "HEAD"]).strip().decode()
return "custom_{}_{}".format(branch_name, commit_hash)
except subprocess.CalledProcessError:
except (subprocess.CalledProcessError, FileNotFoundError):
return "unknown version"

View File

@ -19,7 +19,7 @@ def generate_pot_version():
branch_name = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).strip().decode()
commit_hash = subprocess.check_output(["git", "rev-parse", "HEAD"]).strip().decode()
return "custom_{}_{}".format(branch_name, commit_hash)
except subprocess.CalledProcessError:
except (subprocess.CalledProcessError, FileNotFoundError):
return "unknown version"