##// END OF EJS Templates
flush on newline in subprocesses...
MinRK -
Show More
@@ -90,6 +90,7 b' class OutStream(object):'
90 90 return MASTER
91 91 else:
92 92 if not self._have_pipe_out():
93 self._flush_buffer()
93 94 # setup a new out pipe
94 95 self._setup_pipe_out()
95 96 return CHILD
@@ -174,8 +175,15 b' class OutStream(object):'
174 175 # Make sure that we're handling unicode
175 176 if not isinstance(string, unicode):
176 177 string = string.decode(self.encoding, 'replace')
178
179 is_child = (self._check_mp_mode() == CHILD)
177 180 self._buffer.write(string)
178 self._check_mp_mode()
181 if is_child:
182 # newlines imply flush in subprocesses
183 # mp.Pool cannot be trusted to flush promptly (or ever),
184 # and this helps.
185 if '\n' in string:
186 self.flush()
179 187 # do we want to check subprocess flushes on write?
180 188 # self._flush_from_subprocesses()
181 189 current_time = time.time()
General Comments 0
You need to be logged in to leave comments. Login now