misc: fix wrong builtin exception name (#60558)

This commit is contained in:
Paul Marillonnet 2022-01-12 15:21:58 +01:00
parent 7c5c21fd3b
commit a247a80f12
1 changed files with 2 additions and 2 deletions

4
git.py
View File

@ -135,13 +135,13 @@ def rev_list_commits(*args, **kwargs):
kwargs_copy['_split_lines'] = True
lines = git.rev_list(*args, **kwargs_copy)
if (len(lines) % 2 != 0):
raise RuntimeException("git rev-list didn't return an even number of lines")
raise RuntimeError("git rev-list didn't return an even number of lines")
result = []
for i in xrange(0, len(lines), 2):
m = re.match("commit\s+([A-Fa-f0-9]+)", lines[i])
if not m:
raise RuntimeException("Can't parse commit it '%s'", lines[i])
raise RuntimeError("Can't parse commit it '%s'" % lines[i])
commit_id = m.group(1)
subject = lines[i + 1]
result.append(GitCommit(commit_id, subject))