Skip to content

Commit 23392f8

Browse files
authored
Merge pull request #7606 from tacaswell/mnt_more_paranoid_moviewriter_saving_cm
MNT: tweak MovieWriter.saving to be more cautious
2 parents 4d59447 + 437386b commit 23392f8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/animation.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,10 @@ def saving(self, *args, **kw):
250250
'''
251251
# This particular sequence is what contextlib.contextmanager wants
252252
self.setup(*args, **kw)
253-
yield
254-
self.finish()
253+
try:
254+
yield self
255+
finally:
256+
self.finish()
255257

256258
def _run(self):
257259
# Uses subprocess to call the program for assembling frames into a

0 commit comments

Comments
 (0)