diff mercurial/minirst.py @ 14168:135e244776f0

prevent transient leaks of file handle by using new helper functions These leaks may occur in environments that don't employ a reference counting GC, i.e. PyPy. This implies: - changing opener(...).read() calls to opener.read(...) - changing opener(...).write() calls to opener.write(...) - changing open(...).read(...) to util.readfile(...) - changing open(...).write(...) to util.writefile(...)
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Mon, 02 May 2011 10:11:18 +0200
parents 4936a04b6792
children 7658221da551
line wrap: on
line diff
--- a/mercurial/minirst.py	Mon May 02 10:11:05 2011 +0200
+++ b/mercurial/minirst.py	Mon May 02 10:11:18 2011 +0200
@@ -467,7 +467,7 @@
         print
         return blocks
 
-    text = open(sys.argv[1]).read()
+    text = util.readfile(sys.argv[1])
     blocks = debug(findblocks, text)
     blocks = debug(findliteralblocks, blocks)
     blocks, pruned = debug(prunecontainers, blocks, sys.argv[2:])