8000 Revert the clenaup changes · matplotlib/matplotlib@520120b · GitHub
[go: up one dir, main page]

Skip to content

Commit 520120b

Browse files
authored
Revert the clenaup changes
1 parent 0205618 commit 520120b

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

lib/matplotlib/animation.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
# * Can blit be enabled for movies?
1818
# * Need to consider event sources to allow clicking through multiple figures
1919

20-
2120
import abc
2221
import base64
2322
import contextlib
@@ -482,15 +481,14 @@ def grab_frame(self, **savefig_kwargs):
482481
def finish(self):
483482
# Call run here now that all frame grabbing is done. All temp files
484483
# are available to be assembled.
485-
try:
486-
self._run()
487-
super().finish()
488-
finally:
489-
if self._tmpdir:
490-
_log.debug(
491-
'MovieWriter: clearing temporary path=%s', self._tmpdir
492-
)
493-
self._tmpdir.cleanup()
484+
self._run()
485+
super().finish() # Will call clean-up
486+
487+
def _cleanup(self): # Inline to finish() once cleanup() is removed.
488+
super()._cleanup()
489+
if self._tmpdir:
490+
_log.debug('MovieWriter: clearing temporary path=%s', self._tmpdir)
491+
self._tmpdir.cleanup()
494492

495493

496494
@writers.register('pillow')

0 commit comments

Comments
 (0)
0