diff options
Diffstat (limited to 'scripts/merge_check.py')
| -rw-r--r-- | scripts/merge_check.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/merge_check.py b/scripts/merge_check.py index c4cbdceca..a5a098964 100644 --- a/scripts/merge_check.py +++ b/scripts/merge_check.py | |||
| @@ -42,7 +42,10 @@ class GitError(Exception): | |||
| 42 | 42 | ||
| 43 | 43 | ||
| 44 | def git(repo, *args, check=True): | 44 | def git(repo, *args, check=True): |
| 45 | r = subprocess.run(["git", "-C", repo, *args], capture_output=True) | 45 | try: |
| 46 | r = subprocess.run(["git", "-C", repo, *args], capture_output=True) | ||
| 47 | except OSError as e: # git is not on PATH, or cannot be executed: a usage error (exit 2), not a traceback | ||
| 48 | raise GitError(f"cannot run git: {e.strerror or e}") from None | ||
| 46 | # Decode without universal-newline translation: a bare CR inside a Git line is content. | 49 | # Decode without universal-newline translation: a bare CR inside a Git line is content. |
| 47 | r.stdout = r.stdout.decode("utf-8", "replace") | 50 | r.stdout = r.stdout.decode("utf-8", "replace") |
| 48 | r.stderr = r.stderr.decode("utf-8", "replace") | 51 | r.stderr = r.stderr.decode("utf-8", "replace") |