##// END OF EJS Templates
profile: properly propagate exception from the sub-context manager...
marmoute -
r32810:6675d23d default
parent child Browse files
Show More
@@ -214,8 +214,10 b' class profile(object):'
214 raise
214 raise
215
215
216 def __exit__(self, exception_type, exception_value, traceback):
216 def __exit__(self, exception_type, exception_value, traceback):
217 propagate = None
217 if self._profiler is not None:
218 if self._profiler is not None:
218 self._profiler.__exit__(exception_type, exception_value, traceback)
219 propagate = self._profiler.__exit__(exception_type, exception_value,
220 traceback)
219 if self._output == 'blackbox':
221 if self._output == 'blackbox':
220 val = 'Profile:\n%s' % self._fp.getvalue()
222 val = 'Profile:\n%s' % self._fp.getvalue()
221 # ui.log treats the input as a format string,
223 # ui.log treats the input as a format string,
@@ -223,6 +225,7 b' class profile(object):'
223 val = val.replace('%', '%%')
225 val = val.replace('%', '%%')
224 self._ui.log('profile', val)
226 self._ui.log('profile', val)
225 self._closefp()
227 self._closefp()
228 return propagate
226
229
227 def _closefp(self):
230 def _closefp(self):
228 if self._fpdoclose and self._fp is not None:
231 if self._fpdoclose and self._fp is not None:
General Comments 0
You need to be logged in to leave comments. Login now