convert: fix a file descriptor leak
test-check-code flagged this after I changed this line for something unrelated.
--- a/hgext/convert/gnuarch.py Wed Sep 26 20:33:09 2018 +0900
+++ b/hgext/convert/gnuarch.py Tue Sep 25 22:46:18 2018 -0400
@@ -18,6 +18,7 @@
encoding,
error,
pycompat,
+ util,
)
from mercurial.utils import (
dateutil,
@@ -228,7 +229,7 @@
else:
mode = ''
else:
- data = open(os.path.join(self.tmppath, name), 'rb').read()
+ data = util.readfile(os.path.join(self.tmppath, name))
mode = (mode & 0o111) and 'x' or ''
return data, mode