chromium/chromium-93.0.4577.63-clang-format.patch

35 lines
1.4 KiB
Diff
Raw Normal View History

2021-09-03 21:34:13 +00:00
diff -up chromium-93.0.4577.63/buildtools/linux64/clang-format.clang-format-py3 chromium-93.0.4577.63/buildtools/linux64/clang-format
--- chromium-93.0.4577.63/buildtools/linux64/clang-format.clang-format-py3 2021-09-03 04:42:46.736294345 +0000
+++ chromium-93.0.4577.63/buildtools/linux64/clang-format 2021-09-03 04:59:55.296512600 +0000
@@ -10,9 +10,9 @@ import sys
args = sys.argv[1:]
inputfiles = [a for a in args if not a.startswith('-')]
-contents = ''
+contents = b''
if '-' in args or not inputfiles:
- contents = sys.stdin.read()
+ contents = sys.stdin.buffer.read()
# Tarball builds may or may not have depot_tools in $PATH. In the former case,
# running 'clang-format' will call back into this script infinitely. Strip off
@@ -34,14 +34,14 @@ try:
stdout, stderr = proc.communicate(input=contents)
# Ignore if clang-format fails. Eg: it may be too old to support C++14.
if proc.returncode == 0:
- sys.stdout.write(stdout)
- sys.stderr.write(stderr)
+ sys.stdout.buffer.write(stdout)
+ sys.stderr.buffer.write(stderr)
sys.exit(0)
except OSError:
# Ignore if clang-format is not installed.
pass
# If any failure happens, continue with unformatted files.
-sys.stdout.write(contents)
+sys.stdout.buffer.write(contents)
for inputfile in inputfiles:
- sys.stdout.write(open(inputfile).read())
+ sys.stdout.buffer.write(open(inputfile).read())