[py-svn] py-trunk commit 0d98a3be27c4: flush looponfail output to get around line-buffering

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sun Oct 18 20:50:04 CEST 2009


# HG changeset patch -- Bitbucket.org
# Project py-trunk
# URL http://bitbucket.org/hpk42/py-trunk/overview/
# User Ronny Pfannschmidt <Ronny.Pfannschmidt at gmx.de>
# Date 1255897818 -7200
# Node ID 0d98a3be27c4c3234a3771a5b23c3c58a39e3003
# Parent a416dddd664e20bb15fa5a03eb16887c1b4cefe0
flush looponfail output to get around line-buffering

--- a/_py/test/looponfail/remote.py
+++ b/_py/test/looponfail/remote.py
@@ -79,7 +79,10 @@ class RemoteControl(object):
             slave_runsession(channel, config, fullwidth, hasmarkup) 
         """)
         remote_outchannel = channel.receive()
-        remote_outchannel.setcallback(out._file.write)
+        def write(s):
+            out._file.write(s)
+            out._file.flush()
+        remote_outchannel.setcallback(write)
         channel = self.channel = PickleChannel(channel)
         channel.send((self.config, out.fullwidth, out.hasmarkup))
         self.trace("set up of slave session complete")



More information about the pytest-commit mailing list