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

Unified Diff: tools/gypv8sh.py

Issue 10388191: Make gypv8sh.py compatible with ninja on Windows. (Closed) Base URL: bombe.local:src/chrome/src@master
Patch Set: update copyright year Created 8 years, 7 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 7018db91f34d019fd459a672bcba71502c3b9889..c45dbfdea68ce4997a6bff4d418c9be956b65121 100755
--- a/tools/gypv8sh.py
+++ b/tools/gypv8sh.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -11,16 +11,14 @@ Usage:
inputfile inputrelfile cxxoutfile jsoutfile
"""
-try:
- import json
-except ImportError:
- import simplejson as json
+import json
import optparse
import os
import subprocess
import sys
import shutil
+
def main ():
parser = optparse.OptionParser()
parser.set_usage(
@@ -42,13 +40,16 @@ def main ():
print cmd
if not opts.impotent:
try:
- subprocess.check_call(cmd, stdout=open(cxxoutfile, 'w'))
+ with open(cxxoutfile, 'w') as f:
+ subprocess.check_call(cmd, stdin=subprocess.PIPE, stdout=f)
shutil.copyfile(inputfile, jsoutfile)
except Exception, ex:
- print ex
- os.remove(cxxoutfile)
- os.remove(jsoutfile)
- sys.exit(1)
+ if os.path.exists(cxxoutfile):
+ os.remove(cxxoutfile)
+ if os.path.exists(jsoutfile):
+ os.remove(jsoutfile)
+ raise
+
if __name__ == '__main__':
sys.exit(main())
« 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