# HG changeset patch # User Yuya Nishihara # Date 2018-03-24 05:32:34 # Node ID e7b517809ebc120e4f30cbe5ebec176724ae6c78 # Parent 7ccc9b8aca4c96e2e55cb2010313dd800fca4c61 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. diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -1528,7 +1528,8 @@ def tempfilter(s, cmd): 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: