changeset 39833:28626957395a

convert: fix a file descriptor leak test-check-code flagged this after I changed this line for something unrelated.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 25 Sep 2018 22:46:18 -0400
parents 85a474adaf26
children d1e0b905c59d
files hgext/convert/gnuarch.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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