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

Unified Diff: third_party/WebKit/Source/build/scripts/make_css_property_names.py

Issue 2517383003: webkit: Use subprocess.check_output
Patch Set: Created 4 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/build/scripts/make_css_property_names.py
diff --git a/third_party/WebKit/Source/build/scripts/make_css_property_names.py b/third_party/WebKit/Source/build/scripts/make_css_property_names.py
index 887a713a43b3ad502531703ce9aadb433627bbdd..c95a4440c7ce72cff64a68d9343bec18f117cacd 100755
--- a/third_party/WebKit/Source/build/scripts/make_css_property_names.py
+++ b/third_party/WebKit/Source/build/scripts/make_css_property_names.py
@@ -226,7 +226,6 @@ class CSSPropertyNamesWriter(css_properties.CSSProperties):
'property_name_offsets': '\n'.join(' %d,' % offset for offset in property_offsets),
'property_to_enum_map': '\n'.join('%s, %s' % property for property in css_name_and_enum_pairs),
}
- # FIXME: If we could depend on Python 2.7, we would use subprocess.check_output
gperf_args = [self.gperf_path, '--key-positions=*', '-P', '-n']
gperf_args.extend(['-m', '50']) # Pick best of 50 attempts.
gperf_args.append('-D') # Allow duplicate hashes -> More compact code.
@@ -236,8 +235,7 @@ class CSSPropertyNamesWriter(css_properties.CSSProperties):
# platforms), so instead we catch the error and raise a
# CalledProcessError like subprocess would do when shell=True is set.
try:
- gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True)
- return gperf.communicate(gperf_input)[0]
+ return subprocess.check_output(gperf_args, universal_newlines=True)
except OSError:
raise subprocess.CalledProcessError(127, gperf_args, output='Command not found.')
« 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