Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: build/config/mac/compile_ib_files.py

Issue 2947393002: compile_ib_files.py: Wait for subprocess.Popen() to finish. (Closed)
Patch Set: Removed brackets on every print usage for consistency. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 5
6 import argparse 6 import argparse
7 import logging 7 import logging
8 import os 8 import os
9 import re 9 import re
10 import subprocess 10 import subprocess
(...skipping 22 matching lines...) Expand all
33 ] 33 ]
34 ibtool_args += unknown_args 34 ibtool_args += unknown_args
35 ibtool_args += [ 35 ibtool_args += [
36 '--compile', 36 '--compile',
37 os.path.abspath(args.output), 37 os.path.abspath(args.output),
38 os.path.abspath(args.input) 38 os.path.abspath(args.input)
39 ] 39 ]
40 40
41 ibtool_section_re = re.compile(r'/\*.*\*/') 41 ibtool_section_re = re.compile(r'/\*.*\*/')
42 ibtool_re = re.compile(r'.*note:.*is clipping its content') 42 ibtool_re = re.compile(r'.*note:.*is clipping its content')
43 ibtoolout = subprocess.Popen(ibtool_args, stdout=subprocess.PIPE) 43 try:
44 stdout = subprocess.check_output(ibtool_args)
45 except subprocess.CalledProcessError as e:
46 print e.output
47 raise
44 current_section_header = None 48 current_section_header = None
45 for line in ibtoolout.stdout: 49 for line in stdout.splitlines():
46 if ibtool_section_re.match(line): 50 if ibtool_section_re.match(line):
47 current_section_header = line 51 current_section_header = line
48 elif not ibtool_re.match(line): 52 elif not ibtool_re.match(line):
49 if current_section_header: 53 if current_section_header:
50 sys.stdout.write(current_section_header) 54 print current_section_header
sdefresne 2017/06/23 16:48:57 nit: can you either use "print(ccurent_section_hea
51 current_section_header = None 55 current_section_header = None
52 sys.stdout.write(line) 56 print line
53 return ibtoolout.returncode 57 return 0
54 58
55 59
56 if __name__ == '__main__': 60 if __name__ == '__main__':
57 sys.exit(main()) 61 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698