##// END OF EJS Templates
profiling: flush stdout before writing profile to stderr...
Kyle Lippincott -
r44653:d6d41708 default
parent child Browse files
Show More
@@ -186,6 +186,7 b' class profile(object):'
186 186 self._output = None
187 187 self._fp = None
188 188 self._fpdoclose = True
189 self._flushfp = None
189 190 self._profiler = None
190 191 self._enabled = enabled
191 192 self._entered = False
@@ -246,6 +247,8 b' class profile(object):'
246 247 else:
247 248 self._fpdoclose = False
248 249 self._fp = self._ui.ferr
250 # Ensure we've flushed fout before writing to ferr.
251 self._flushfp = self._ui.fout
249 252
250 253 if proffn is not None:
251 254 pass
@@ -265,6 +268,7 b' class profile(object):'
265 268 def __exit__(self, exception_type, exception_value, traceback):
266 269 propagate = None
267 270 if self._profiler is not None:
271 self._uiflush()
268 272 propagate = self._profiler.__exit__(
269 273 exception_type, exception_value, traceback
270 274 )
@@ -280,3 +284,7 b' class profile(object):'
280 284 def _closefp(self):
281 285 if self._fpdoclose and self._fp is not None:
282 286 self._fp.close()
287
288 def _uiflush(self):
289 if self._flushfp:
290 self._flushfp.flush()
General Comments 0
You need to be logged in to leave comments. Login now