changeset 27768:5ef99738a562

util: replace file I/O with readfile
author Bryan O'Sullivan <bryano@fb.com>
date Tue, 12 Jan 2016 16:16:19 -0800
parents ddfb8887212d
children 40bd01be5c25
files mercurial/util.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Tue Jan 12 15:57:18 2016 -0800
+++ b/mercurial/util.py	Tue Jan 12 16:16:19 2016 -0800
@@ -756,10 +756,7 @@
         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: