changeset 25053:4f2c74ef8128

run-tests: write bytes to the binary buffer on sys.{stdout,stderr}
author Augie Fackler <augie@google.com>
date Tue, 14 Apr 2015 16:24:32 -0400
parents c4217a046b62
children af5a778f8e2e
files tests/run-tests.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Tue Apr 14 16:21:10 2015 -0400
+++ b/tests/run-tests.py	Tue Apr 14 16:24:32 2015 -0400
@@ -1290,8 +1290,13 @@
                 else:
                     self.stream.write('\n')
                     for line in lines:
-                        self.stream.write(line)
-                    self.stream.flush()
+                        if sys.version_info[0] > 2:
+                            self.stream.flush()
+                            self.stream.buffer.write(line)
+                            self.stream.buffer.flush()
+                        else:
+                            self.stream.write(line)
+                            self.stream.flush()
 
             # handle interactive prompt without releasing iolock
             if self._options.interactive: