Skip to content

Commit 04bb510

Browse files
duongnhnCommit Bot
authored andcommitted
Reland "Make format torque tools work on win"
This is a reland of 1fdf640 Original change's description: > Make format torque tools work on win > > Reformatting Torque file is required to upload a CL > but it can only work on POSIX > > Change-Id: I51283e3f6b29abf492be7efb5b8f10454d09fb37 > Reviewed-on: https://chromium-review.googlesource.com/c/1475919 > Reviewed-by: Michael Stanton <mvstanton@chromium.org> > Commit-Queue: Michael Stanton <mvstanton@chromium.org> > Cr-Commit-Position: refs/heads/master@{#59719} Change-Id: I09a19a9989091205eb413fd60b2e8bec289092fd Reviewed-on: https://chromium-review.googlesource.com/c/1479530 Commit-Queue: Michael Stanton <mvstanton@chromium.org> Reviewed-by: Michael Stanton <mvstanton@chromium.org> Cr-Commit-Position: refs/heads/master@{#59748}
1 parent db69e08 commit 04bb510

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tools/torque/format-torque.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ def process(filename, lint, should_format):
9595

9696
original_input = content
9797

98-
p = Popen(['clang-format', '-assume-filename=.ts'], stdin=PIPE, stdout=PIPE, stderr=PIPE)
98+
if sys.platform.startswith('win'):
99+
p = Popen(['clang-format', '-assume-filename=.ts'], stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=True)
100+
else:
101+
p = Popen(['clang-format', '-assume-filename=.ts'], stdin=PIPE, stdout=PIPE, stderr=PIPE)
99102
output, err = p.communicate(preprocess(content))
100103
output = postprocess(output)
101104
rc = p.returncode

0 commit comments

Comments
 (0)