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

Unified Diff: tools/gypv8sh.py

Issue 364623002: Use subprocess.Popen to communicate with d8 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 6 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 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: tools/gypv8sh.py
diff --git a/tools/gypv8sh.py b/tools/gypv8sh.py
index b8bd4066ec28ae2a5b5b9a33e5a2e36e0ceff14b..cb98f4cb6b88101451e0857fc776d9f2ba21fc1e 100755
--- a/tools/gypv8sh.py
+++ b/tools/gypv8sh.py
@@ -44,13 +44,15 @@ def main ():
print cmd
if not opts.impotent:
try:
- with open(cxxoutfile, 'w') as f:
- subprocess.check_call(cmd, stdin=subprocess.PIPE, stdout=f)
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE, bufsize=0)
+ out, err = p.communicate()
+ if p.returncode:
+ raise Exception('Failed to run d8', out, err)
+ with open(cxxoutfile, 'wb') as f:
+ f.write(out)
shutil.copyfile(inputfile, jsoutfile)
except Exception, ex:
if os.path.exists(cxxoutfile):
- # The contents of the output file will include the error message.
- print open(cxxoutfile).read()
os.remove(cxxoutfile)
if os.path.exists(jsoutfile):
os.remove(jsoutfile)
« 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