ui: indent _writenobuf() to prepare moving bits from _write() functions
authorYuya Nishihara <yuya@tcha.org>
Sat, 03 Nov 2018 17:43:57 +0900
changeset 40523 0c7b2035a604
parent 40522 51091816a355
child 40524 25732c5678bc
ui: indent _writenobuf() to prepare moving bits from _write() functions
mercurial/ui.py
--- a/mercurial/ui.py	Sat Nov 03 17:42:05 2018 +0900
+++ b/mercurial/ui.py	Sat Nov 03 17:43:57 2018 +0900
@@ -952,15 +952,18 @@
     def _writenobuf(self, write, *args, **opts):
         self._progclear()
         msg = b''.join(args)
-        if self._colormode == 'win32':
-            # windows color printing is its own can of crab, defer to
-            # the color module and that is it.
-            color.win32print(self, write, msg, **opts)
-        else:
-            if self._colormode is not None:
-                label = opts.get(r'label', '')
-                msg = self.label(msg, label)
-            write(msg)
+        try:
+            if self._colormode == 'win32':
+                # windows color printing is its own can of crab, defer to
+                # the color module and that is it.
+                color.win32print(self, write, msg, **opts)
+            else:
+                if self._colormode is not None:
+                    label = opts.get(r'label', '')
+                    msg = self.label(msg, label)
+                write(msg)
+        finally:
+            pass
 
     def _write(self, data):
         # opencode timeblockedsection because this is a critical path