setup.py
changeset 13400 14f3795a5ed7
parent 12865 4c50552fc9bc
child 13583 e42d18538e1d
--- a/setup.py	Fri Feb 11 22:24:10 2011 +0800
+++ b/setup.py	Fri Dec 24 15:23:01 2010 +0100
@@ -294,14 +294,18 @@
             libdir =  uplevel * ('..' + os.sep) + self.install_lib[len(common):]
 
         for outfile in self.outfiles:
-            data = open(outfile, 'rb').read()
+            fp = open(outfile, 'rb')
+            data = fp.read()
+            fp.close()
 
             # skip binary files
             if '\0' in data:
                 continue
 
             data = data.replace('@LIBDIR@', libdir.encode('string_escape'))
-            open(outfile, 'wb').write(data)
+            fp = open(outfile, 'wb')
+            fp.write(data)
+            fp.close()
 
 cmdclass = {'build_mo': hgbuildmo,
             'build_ext': hgbuildext,