author | Matt Harbison <matt_harbison@yahoo.com> |
Fri, 28 Sep 2018 22:18:45 -0400 | |
changeset 39905 | 4017968f0a1d |
parent 39904 | 5fe0b880200e |
child 39906 | 2327abace563 |
mercurial/util.py | file | annotate | diff | comparison | revisions |
--- a/mercurial/util.py Tue Sep 25 21:16:12 2018 -0400 +++ b/mercurial/util.py Fri Sep 28 22:18:45 2018 -0400 @@ -1848,10 +1848,8 @@ raise except AttributeError: # no symlink in os pass - fp = posixfile(pathname, 'rb') - r = fp.read() - fp.close() - return r + with posixfile(pathname, 'rb') as fp: + return fp.read() def fstat(fp): '''stat file object that may not have fileno method.'''