Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a367714

Browse filesBrowse files
committed
FIX: leaking temporary files in animation saving
1 parent bb99770 commit a367714
Copy full SHA for a367714

File tree

Expand file treeCollapse file tree

1 file changed

+7
-9
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-9
lines changed

‎lib/matplotlib/animation.py

Copy file name to clipboardExpand all lines: lib/matplotlib/animation.py
+7-9Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -468,15 +468,13 @@ def grab_frame(self, **savefig_kwargs):
468468
def finish(self):
469469
# Call run here now that all frame grabbing is done. All temp files
470470
# are available to be assembled.
471-
self._run()
472-
super().finish() # Will call clean-up
473-
474-
def _cleanup(self): # Inline to finish() once cleanup() is removed.
475-
super()._cleanup()
476-
if self._tmpdir:
477-
_log.debug('MovieWriter: clearing temporary path=%s', self._tmpdir)
478-
self._tmpdir.cleanup()
479-
471+
try:
472+
self._run()
473+
super().finish()
474+
finally:
475+
if self._tmpdir:
476+
_log.debug('MovieWriter: clearing temporary path=%s', self._tmpdir)
477+
self._tmpdir.cleanup()
480478

481479
@writers.register('pillow')
482480
class PillowWriter(AbstractMovieWriter):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.