changeset 37120:e7b517809ebc

util: stop using readfile() in tempfilter() To unblock code move to utils.*. It's merely two lines of very Pythonic code. No helper function should be needed.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 24 Mar 2018 14:32:34 +0900
parents 7ccc9b8aca4c
children 5be286db5fb5
files mercurial/util.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Sat Mar 24 14:38:34 2018 +0900
+++ b/mercurial/util.py	Sat Mar 24 14:32:34 2018 +0900
@@ -1528,7 +1528,8 @@
         if code:
             raise error.Abort(_("command '%s' failed: %s") %
                               (cmd, explainexit(code)))
-        return readfile(outname)
+        with open(outname, 'rb') as fp:
+            return fp.read()
     finally:
         try:
             if inname: