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

Skip to content

Commit decb243

Browse files
committed
Fix Animation.save
1 parent 95f6280 commit decb243

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/animation.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,10 @@ def func(current_frame: int, total_frames: int) -> Any
11341134
# Clear the initial frame
11351135
anim._init_draw()
11361136
frame_number = 0
1137-
save_count_list = [a.save_count for a in all_anim]
1137+
# TODO: Currently only FuncAnimation has a save_count
1138+
# attribute. Can we generalize this to all Animations?
1139+
save_count_list = [getattr(a, 'save_count', None)
1140+
for a in all_anim]
11381141
if None in save_count_list:
11391142
total_frames = None
11401143
else:

0 commit comments

Comments
 (0)