Skip to content

Commit d9db266

Browse files
authored
[PowerPC][test] Catch any exception when retrieving git revision (#92004)
This makes the `vc-rev-enabled` feature unsupported if we fail to retrieve the git revision for any reason, such as if git is not installed.
1 parent 2b15c4a commit d9db266

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/test/CodeGen/PowerPC/lit.local.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ def get_revision(repo_path):
99
cmd = ['git', '-C', repo_path, 'rev-parse', 'HEAD']
1010
try:
1111
return subprocess.run(cmd, stdout=subprocess.PIPE, check=True).stdout.decode()
12-
except subprocess.CalledProcessError:
13-
print("An error occurred retrieving the git revision.")
12+
except Exception as e:
13+
print("An error occurred retrieving the git revision:", e)
1414
return None
1515

1616
if config.have_vc_rev:

0 commit comments

Comments
 (0)