changeset 40523:0c7b2035a604

ui: indent _writenobuf() to prepare moving bits from _write() functions
author Yuya Nishihara <yuya@tcha.org>
date Sat, 03 Nov 2018 17:43:57 +0900
parents 51091816a355
children 25732c5678bc
files mercurial/ui.py
diffstat 1 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- 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