fix: add shell = True to make clang-format work on Windows (#14121)

This commit is contained in:
Heilig Benedek 2018-09-07 01:49:43 +02:00 committed by Samuel Attard
parent 826af1d676
commit 8e963f10ef

View file

@ -110,7 +110,8 @@ def run_clang_format_diff(args, file_name):
invocation, invocation,
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True) universal_newlines=True,
shell = True)
except OSError as exc: except OSError as exc:
raise DiffError(str(exc)) raise DiffError(str(exc))
proc_stdout = proc.stdout proc_stdout = proc.stdout
@ -254,7 +255,8 @@ def main():
popen = subprocess.Popen( popen = subprocess.Popen(
["git", "diff", "--name-only", "--cached"], ["git", "diff", "--name-only", "--cached"],
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT stderr=subprocess.STDOUT,
shell = True
) )
for line in popen.stdout: for line in popen.stdout:
file_name = line.rstrip() file_name = line.rstrip()