hgext/mq.py
changeset 36107 bff95b002e33
parent 36106 c33a99506e13
child 36281 d822f3fb6be8
--- a/hgext/mq.py	Sun Feb 11 15:55:47 2018 -0800
+++ b/hgext/mq.py	Sun Feb 11 15:58:31 2018 -0800
@@ -445,9 +445,9 @@
     def __init__(self, ui, baseui, path, patchdir=None):
         self.basepath = path
         try:
-            fh = open(os.path.join(path, 'patches.queue'))
-            cur = fh.read().rstrip()
-            fh.close()
+            with open(os.path.join(path, 'patches.queue'), r'rb') as fh:
+                cur = fh.read().rstrip()
+
             if not cur:
                 curpath = os.path.join(path, 'patches')
             else: