Show More
@@ -106,18 +106,6 b' if isatty(stdout):' | |||||
106 | else: |
|
106 | else: | |
107 | stdout = os.fdopen(stdout.fileno(), 'wb', 1) |
|
107 | stdout = os.fdopen(stdout.fileno(), 'wb', 1) | |
108 |
|
108 | |||
109 | # stderr should be unbuffered |
|
|||
110 | if pycompat.ispy3: |
|
|||
111 | # On Python 3, buffered streams may expose an underlying raw stream. This is |
|
|||
112 | # definitively the case for the streams initialized by the interpreter. If |
|
|||
113 | # the attribute isn't present, the stream is already unbuffered or doesn't |
|
|||
114 | # expose an underlying raw stream, in which case we use the stream as-is. |
|
|||
115 | stderr = getattr(stderr, 'raw', stderr) |
|
|||
116 | elif pycompat.iswindows: |
|
|||
117 | # On Windows, stderr is buffered at least when connected to a pipe. |
|
|||
118 | stderr = os.fdopen(stderr.fileno(), 'wb', 0) |
|
|||
119 | # On other platforms, stderr is always unbuffered. |
|
|||
120 |
|
||||
121 |
|
109 | |||
122 | findexe = platform.findexe |
|
110 | findexe = platform.findexe | |
123 | _gethgcmd = platform.gethgcmd |
|
111 | _gethgcmd = platform.gethgcmd |
@@ -126,18 +126,6 b' class TestStdio(unittest.TestCase):' | |||||
126 | test_buffering_stdout_ptys_unbuffered |
|
126 | test_buffering_stdout_ptys_unbuffered | |
127 | ) |
|
127 | ) | |
128 |
|
128 | |||
129 | def test_buffering_stderr_pipes(self): |
|
|||
130 | self._test('stderr', _pipes, UNBUFFERED) |
|
|||
131 |
|
||||
132 | def test_buffering_stderr_ptys(self): |
|
|||
133 | self._test('stderr', _ptys, UNBUFFERED) |
|
|||
134 |
|
||||
135 | def test_buffering_stderr_pipes_unbuffered(self): |
|
|||
136 | self._test('stderr', _pipes, UNBUFFERED, python_args=['-u']) |
|
|||
137 |
|
||||
138 | def test_buffering_stderr_ptys_unbuffered(self): |
|
|||
139 | self._test('stderr', _ptys, UNBUFFERED, python_args=['-u']) |
|
|||
140 |
|
||||
141 |
|
129 | |||
142 | if __name__ == '__main__': |
|
130 | if __name__ == '__main__': | |
143 | import silenttestrunner |
|
131 | import silenttestrunner |
General Comments 0
You need to be logged in to leave comments.
Login now