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

Unified Diff: build/check_gn_headers.py

Issue 2844623002: Revert of Optimize check_gn_headers.py for speed (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/check_gn_headers_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/check_gn_headers.py
diff --git a/build/check_gn_headers.py b/build/check_gn_headers.py
index 3e04120dd94ec13b084b0a87e1cadf817cac0487..ae1ef49c179abd1faa254180d859042beebe773d 100755
--- a/build/check_gn_headers.py
+++ b/build/check_gn_headers.py
@@ -19,21 +19,7 @@
def GetHeadersFromNinja(out_dir):
"""Return all the header files from ninja_deps"""
-
- def NinjaSource():
- cmd = ['ninja', '-C', out_dir, '-t', 'deps']
- # A negative bufsize means to use the system default, which usually
- # means fully buffered.
- popen = subprocess.Popen(cmd, stdout=subprocess.PIPE, bufsize=-1)
- for line in iter(popen.stdout.readline, ''):
- yield line
-
- popen.stdout.close()
- return_code = popen.wait()
- if return_code:
- raise subprocess.CalledProcessError(return_code, cmd)
-
- ninja_out = NinjaSource()
+ ninja_out = subprocess.check_output(['ninja', '-C', out_dir, '-t', 'deps'])
return ParseNinjaDepsOutput(ninja_out)
@@ -44,7 +30,7 @@
prefix = '..' + os.sep + '..' + os.sep
is_valid = False
- for line in ninja_out:
+ for line in ninja_out.split('\n'):
if line.startswith(' '):
if not is_valid:
continue
« no previous file with comments | « no previous file | build/check_gn_headers_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698