##// END OF EJS Templates
profile: close 'fp' on error within '__enter__'...
marmoute -
r32808:33670074 default
parent child Browse files
Show More
@@ -188,7 +188,7 b' class profile(object):'
188
188
189 self._output = self._ui.config('profiling', 'output')
189 self._output = self._ui.config('profiling', 'output')
190
190
191 if True:
191 try:
192 if self._output == 'blackbox':
192 if self._output == 'blackbox':
193 self._fp = util.stringio()
193 self._fp = util.stringio()
194 elif self._output:
194 elif self._output:
@@ -209,6 +209,9 b' class profile(object):'
209
209
210 self._profiler = proffn(self._ui, self._fp)
210 self._profiler = proffn(self._ui, self._fp)
211 self._profiler.__enter__()
211 self._profiler.__enter__()
212 except: # re-raises
213 self._closefp()
214 raise
212
215
213 def __exit__(self, exception_type, exception_value, traceback):
216 def __exit__(self, exception_type, exception_value, traceback):
214 if self._profiler is None:
217 if self._profiler is None:
General Comments 0
You need to be logged in to leave comments. Login now