Close files before opening new ones (#53961)
This commit is contained in:
parent
73e171fd94
commit
231f3e138a
1 changed files with 8 additions and 6 deletions
|
@ -364,6 +364,14 @@ class CallbackModule(CallbackBase):
|
|||
def _profile(self, obj=None):
|
||||
prev_task = None
|
||||
results = dict.fromkeys(self._features)
|
||||
for dummy, f in self._files.items():
|
||||
if f is None:
|
||||
continue
|
||||
try:
|
||||
f.close()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
for name, prof in self._profilers.items():
|
||||
prof.running = False
|
||||
|
@ -397,12 +405,6 @@ class CallbackModule(CallbackBase):
|
|||
def v2_playbook_on_stats(self, stats):
|
||||
self._profile()
|
||||
|
||||
for dummy, f in self._files.items():
|
||||
try:
|
||||
f.close()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if not self._display_recap:
|
||||
return
|
||||
|
||||
|
|
Loading…
Reference in a new issue