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

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: 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 ibtoolout = subprocess.Popen(ibtool_args, stdout=subprocess.PIPE)
Robert Sesek 2017/06/22 15:13:04 Any reason to not use subprocess.check_output?
44 ibtoolout.wait()
44 current_section_header = None 45 current_section_header = None
45 for line in ibtoolout.stdout: 46 for line in ibtoolout.stdout:
46 if ibtool_section_re.match(line): 47 if ibtool_section_re.match(line):
47 current_section_header = line 48 current_section_header = line
48 elif not ibtool_re.match(line): 49 elif not ibtool_re.match(line):
49 if current_section_header: 50 if current_section_header:
50 sys.stdout.write(current_section_header) 51 sys.stdout.write(current_section_header)
51 current_section_header = None 52 current_section_header = None
52 sys.stdout.write(line) 53 sys.stdout.write(line)
53 return ibtoolout.returncode 54 return ibtoolout.returncode
54 55
55 56
56 if __name__ == '__main__': 57 if __name__ == '__main__':
57 sys.exit(main()) 58 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