Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commandserver.py @ 22562:2d85e664c377
cmdserver: get file attributes of 'e'-channel from stdout, not from stderr
It seems wrong to get attributes from object different than the underlying
file. In the following example, it doesn't make sense to flush stderr after
writing to stdout:
self.ferr.write(str(a))
if not getattr(self.ferr, 'closed', False):
self.ferr.flush()
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 27 Sep 2014 12:27:03 +0900 |
parents | 1120b1e2f975 |
children | 8cc5e673cac0 |
comparison
equal
deleted
inserted
replaced
22561:1120b1e2f975 | 22562:2d85e664c377 |
---|---|
151 else: | 151 else: |
152 self.ui = ui | 152 self.ui = ui |
153 self.repo = self.repoui = None | 153 self.repo = self.repoui = None |
154 | 154 |
155 if mode == 'pipe': | 155 if mode == 'pipe': |
156 self.cerr = channeledoutput(sys.stderr, sys.stdout, 'e') | 156 self.cerr = channeledoutput(sys.stdout, sys.stdout, 'e') |
157 self.cout = channeledoutput(sys.stdout, sys.stdout, 'o') | 157 self.cout = channeledoutput(sys.stdout, sys.stdout, 'o') |
158 self.cin = channeledinput(sys.stdin, sys.stdout, 'I') | 158 self.cin = channeledinput(sys.stdin, sys.stdout, 'I') |
159 self.cresult = channeledoutput(sys.stdout, sys.stdout, 'r') | 159 self.cresult = channeledoutput(sys.stdout, sys.stdout, 'r') |
160 | 160 |
161 self.client = sys.stdin | 161 self.client = sys.stdin |