closure.py: Use temporary file names but manual deletion.
Ok Windows+python 2.4
This commit is contained in:
@@ -8,13 +8,14 @@ if not os.path.exists(path):
|
||||
|
||||
def minimize(code):
|
||||
ntf = tempfile.NamedTemporaryFile()
|
||||
ntf.write(code)
|
||||
ntf.flush()
|
||||
ntf.close()
|
||||
open(ntf.name, "w").write(code)
|
||||
|
||||
ntf2 = tempfile.NamedTemporaryFile()
|
||||
ntf2.close()
|
||||
|
||||
os.system("java -jar %s --js %s --js_output_file %s" % (path, ntf.name, ntf2.name))
|
||||
data = open(ntf2.name).read()
|
||||
ntf.close()
|
||||
ntf2.close()
|
||||
os.unlink(ntf.name)
|
||||
os.unlink(ntf2.name)
|
||||
return data
|
||||
|
||||
Reference in New Issue
Block a user