##// END OF EJS Templates
profile: close 'fp' in all cases...
marmoute -
r32809:062eb859 default
parent child Browse files
Show More
@@ -214,15 +214,14 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 if self._profiler is None:
217 if self._profiler is not None:
218 return
218 self._profiler.__exit__(exception_type, exception_value, traceback)
219 self._profiler.__exit__(exception_type, exception_value, traceback)
219 if self._output == 'blackbox':
220 if self._output == 'blackbox':
220 val = 'Profile:\n%s' % self._fp.getvalue()
221 val = 'Profile:\n%s' % self._fp.getvalue()
221 # ui.log treats the input as a format string,
222 # ui.log treats the input as a format string,
222 # so we need to escape any % signs.
223 # so we need to escape any % signs.
223 val = val.replace('%', '%%')
224 val = val.replace('%', '%%')
224 self._ui.log('profile', val)
225 self._ui.log('profile', val)
226 self._closefp()
225 self._closefp()
227
226
228 def _closefp(self):
227 def _closefp(self):
General Comments 0
You need to be logged in to leave comments. Login now