From e2c32531087d1b01d9c97396e44404cb63739578 Mon Sep 17 00:00:00 2001 From: Xavier Mamano Date: Sat, 12 Nov 2011 16:47:57 +0100 Subject: [PATCH] closure.py: Use temporary file names but manual deletion. Ok Windows+python 2.4 --- tools/closure.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/closure.py b/tools/closure.py index 03edbc351d..fb5e1a4781 100644 --- a/tools/closure.py +++ b/tools/closure.py @@ -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