Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / tools / gypv8sh.py
index b8bd406..3f81a8b 100755 (executable)
@@ -44,13 +44,14 @@ 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, stderr=subprocess.PIPE, bufsize=0)
+      out, err = p.communicate()
+      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)