diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py index 2cd5f438037e..418231c11a2f 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -1099,7 +1099,7 @@ def func(current_frame: int, total_frames: int) -> Any extra_args=extra_args, metadata=metadata) else: - alt_writer = next(writers, None) + alt_writer = next(iter(writers), None) if alt_writer is None: raise ValueError("Cannot save animation: no writers are " "available. Please install ffmpeg to "