Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 60b641d

Browse files
committed
Check the return code when saving a movie with files.
When using temporary files, we only run the movie creation process once, rather than keeping an open pipe. As a result, we only get an error here. Without this change, if the process fails, there is no error message.
1 parent ed6a250 commit 60b641d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/matplotlib/animation.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,13 @@ def finish(self):
322322
self._run()
323323
MovieWriter.finish(self) # Will call clean-up
324324

325+
# Check error code for creating file here, since we just run
326+
# the process here, rather than having an open pipe.
327+
if self._proc.returncode:
328+
raise RuntimeError('Error creating movie, return code: '
329+
+ str(self._proc.returncode)
330+
+ ' Try running with --verbose-debug')
331+
325332
def cleanup(self):
326333
MovieWriter.cleanup(self)
327334

0 commit comments

Comments
 (0)