Use clang-apply-replacements when clang-apply-replacements-14 does not exist (#6684)

This commit is contained in:
Markus 2024-05-06 21:17:03 +02:00 committed by GitHub
parent f2caaf85c8
commit d1758a46bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -266,7 +266,12 @@ def main():
if args.fix and failed_files:
print("Applying fixes ...")
try:
subprocess.call(["clang-apply-replacements-14", tmpdir])
try:
subprocess.call(["clang-apply-replacements-14", tmpdir])
except FileNotFoundError:
subprocess.call(["clang-apply-replacements", tmpdir])
except FileNotFoundError:
print("Error please install clang-apply-replacements-14 or clang-apply-replacements.\n", file=sys.stderr)
except:
print("Error applying fixes.\n", file=sys.stderr)
raise