diff mercurial/cmdutil.py @ 30142:3dcaf1c4e90d

largefiles: use context for file closing Make the code slightly smaller and safer (and more deeply indented).
author Mads Kiilerich <madski@unity3d.com>
date Sat, 08 Oct 2016 00:59:41 +0200
parents 2963fba2d18a
children 381293e1135e
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Sat Oct 08 00:59:40 2016 +0200
+++ b/mercurial/cmdutil.py	Sat Oct 08 00:59:41 2016 +0200
@@ -499,6 +499,12 @@
     def __getattr__(self, attr):
         return getattr(self._fp, attr)
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, exc_type, exc_value, exc_tb):
+        pass
+
 def makefileobj(repo, pat, node=None, desc=None, total=None,
                 seqno=None, revwidth=None, mode='wb', modemap=None,
                 pathname=None):