aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-10-28 14:00:39 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-10-28 14:00:39 -0700
commit557b00a6f0e07e8e0244abb1eaa316f668095b38 (patch)
treeb0db5bbba9dc5e83e3310de83253e21b1642edad /tools
parentfab83ed0ade087a4a55648fb09c0c9cc95295a3f (diff)
refactor js optimizer caller a little
Diffstat (limited to 'tools')
-rw-r--r--tools/shared.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/shared.py b/tools/shared.py
index a75a1de6..c0126c32 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -428,9 +428,10 @@ def read_pgo_data(filename):
'overflows_lines': overflows_lines
}
-def run_js_optimizer(command):
+def run_js_optimizer(command): # must be here in the toplevel to be pickleable and used by process pool
+ import subprocess # make this as standalone as possible
filename = command[2] # XXX hackish
- output = Popen(command, stdout=PIPE).communicate()[0]
+ output = subprocess.Popen(command, stdout=subprocess.PIPE).communicate()[0]
assert len(output) > 0 and not output.startswith('Assertion failed'), 'Error in js optimizer: ' + output
filename += '.jo.js'
f = open(filename, 'w')