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 dd92a43

Browse filesBrowse files
committed
Merge pull request #1533 from jakevdp/anim-error
ENH: raise a more informative error
2 parents ad88409 + 80c8c43 commit dd92a43
Copy full SHA for dd92a43

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+7
-1
lines changed

‎lib/matplotlib/animation.py

Copy file name to clipboardExpand all lines: lib/matplotlib/animation.py
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,13 @@ def save(self, filename, writer=None, fps=None, dpi=None, codec=None,
657657
else:
658658
import warnings
659659
warnings.warn("MovieWriter %s unavailable" % writer)
660-
writer = writers.list()[0]
660+
661+
try:
662+
writer = writers.list()[0]
663+
except IndexError:
664+
raise ValueError("Cannot save animation: no writers are "
665+
"available. Please install mencoder or "
666+
"ffmpeg to save animations.")
661667

662668
verbose.report('Animation.save using %s' % type(writer),
663669
level='helpful')

0 commit comments

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