equal
deleted
inserted
replaced
948 self._buffers[-1].extend(args) |
948 self._buffers[-1].extend(args) |
949 else: |
949 else: |
950 self._writenobuf(*args, **opts) |
950 self._writenobuf(*args, **opts) |
951 |
951 |
952 def _writenobuf(self, *args, **opts): |
952 def _writenobuf(self, *args, **opts): |
|
953 self._progclear() |
953 if self._colormode == 'win32': |
954 if self._colormode == 'win32': |
954 # windows color printing is its own can of crab, defer to |
955 # windows color printing is its own can of crab, defer to |
955 # the color module and that is it. |
956 # the color module and that is it. |
956 color.win32print(self, self._write, *args, **opts) |
957 color.win32print(self, self._write, *args, **opts) |
957 else: |
958 else: |
960 label = opts.get(r'label', '') |
961 label = opts.get(r'label', '') |
961 msgs = [self.label(a, label) for a in args] |
962 msgs = [self.label(a, label) for a in args] |
962 self._write(*msgs, **opts) |
963 self._write(*msgs, **opts) |
963 |
964 |
964 def _write(self, *msgs, **opts): |
965 def _write(self, *msgs, **opts): |
965 self._progclear() |
|
966 # opencode timeblockedsection because this is a critical path |
966 # opencode timeblockedsection because this is a critical path |
967 starttime = util.timer() |
967 starttime = util.timer() |
968 try: |
968 try: |
969 self.fout.write(''.join(msgs)) |
969 self.fout.write(''.join(msgs)) |
970 except IOError as err: |
970 except IOError as err: |
972 finally: |
972 finally: |
973 self._blockedtimes['stdio_blocked'] += \ |
973 self._blockedtimes['stdio_blocked'] += \ |
974 (util.timer() - starttime) * 1000 |
974 (util.timer() - starttime) * 1000 |
975 |
975 |
976 def write_err(self, *args, **opts): |
976 def write_err(self, *args, **opts): |
977 self._progclear() |
|
978 if self._bufferstates and self._bufferstates[-1][0]: |
977 if self._bufferstates and self._bufferstates[-1][0]: |
979 self.write(*args, **opts) |
978 self.write(*args, **opts) |
980 elif self._colormode == 'win32': |
979 return |
|
980 self._progclear() |
|
981 if self._colormode == 'win32': |
981 # windows color printing is its own can of crab, defer to |
982 # windows color printing is its own can of crab, defer to |
982 # the color module and that is it. |
983 # the color module and that is it. |
983 color.win32print(self, self._write_err, *args, **opts) |
984 color.win32print(self, self._write_err, *args, **opts) |
984 else: |
985 else: |
985 msgs = args |
986 msgs = args |