# HG changeset patch # User Bryan O'Sullivan # Date 2016-01-13 00:16:19 # Node ID 5ef99738a56200badce6ad240449cf806b0c2d3e # Parent ddfb8887212d1e50cf8b101f8a68c0a3beb1cb90 util: replace file I/O with readfile diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -756,10 +756,7 @@ def tempfilter(s, cmd): if code: raise Abort(_("command '%s' failed: %s") % (cmd, explainexit(code))) - fp = open(outname, 'rb') - r = fp.read() - fp.close() - return r + return readfile(outname) finally: try: if inname: