Show More
@@ -962,6 +962,8 b' class ui(object):' | |||
|
962 | 962 | # opencode timeblockedsection because this is a critical path |
|
963 | 963 | starttime = util.timer() |
|
964 | 964 | try: |
|
965 | if dest is self.ferr and not getattr(self.fout, 'closed', False): | |
|
966 | self.fout.flush() | |
|
965 | 967 | if self._colormode == 'win32': |
|
966 | 968 | # windows color printing is its own can of crab, defer to |
|
967 | 969 | # the color module and that is it. |
@@ -971,15 +973,22 b' class ui(object):' | |||
|
971 | 973 | label = opts.get(r'label', '') |
|
972 | 974 | msg = self.label(msg, label) |
|
973 | 975 | write(msg) |
|
976 | # stderr may be buffered under win32 when redirected to files, | |
|
977 | # including stdout. | |
|
978 | if dest is self.ferr and not getattr(self.ferr, 'closed', False): | |
|
979 | dest.flush() | |
|
980 | except IOError as err: | |
|
981 | if (dest is self.ferr | |
|
982 | and err.errno in (errno.EPIPE, errno.EIO, errno.EBADF)): | |
|
983 | # no way to report the error, so ignore it | |
|
984 | return | |
|
985 | raise error.StdioError(err) | |
|
974 | 986 | finally: |
|
975 | 987 | self._blockedtimes['stdio_blocked'] += \ |
|
976 | 988 | (util.timer() - starttime) * 1000 |
|
977 | 989 | |
|
978 | 990 | def _write(self, data): |
|
979 | try: | |
|
980 | 991 |
|
|
981 | except IOError as err: | |
|
982 | raise error.StdioError(err) | |
|
983 | 992 | |
|
984 | 993 | def write_err(self, *args, **opts): |
|
985 | 994 | if self._bufferstates and self._bufferstates[-1][0]: |
@@ -988,18 +997,7 b' class ui(object):' | |||
|
988 | 997 | self._writenobuf(self.ferr, *args, **opts) |
|
989 | 998 | |
|
990 | 999 | def _write_err(self, data): |
|
991 | try: | |
|
992 | if True: | |
|
993 | if not getattr(self.fout, 'closed', False): | |
|
994 | self.fout.flush() | |
|
995 | 1000 |
|
|
996 | # stderr may be buffered under win32 when redirected to files, | |
|
997 | # including stdout. | |
|
998 | if not getattr(self.ferr, 'closed', False): | |
|
999 | self.ferr.flush() | |
|
1000 | except IOError as inst: | |
|
1001 | if inst.errno not in (errno.EPIPE, errno.EIO, errno.EBADF): | |
|
1002 | raise error.StdioError(inst) | |
|
1003 | 1001 | |
|
1004 | 1002 | def flush(self): |
|
1005 | 1003 | # opencode timeblockedsection because this is a critical path |
General Comments 0
You need to be logged in to leave comments.
Login now