@@ -1113,8 +1113,8 @@ class FuncAnimation(TimedAnimation):
1113
1113
results of drawing from the first item in the frames sequence will be
1114
1114
used. This function will be called once before the first frame.
1115
1115
1116
- If blit=True, *func* and *init_func* should return an iterable of
1117
- drawables to clear .
1116
+ If blit=True, *func* and *init_func* must return an iterable of
1117
+ artists to be re-drawn .
1118
1118
1119
1119
*kwargs* include *repeat*, *repeat_delay*, and *interval*:
1120
1120
*interval* draws a new frame every *interval* milliseconds.
@@ -1195,6 +1195,9 @@ def _init_draw(self):
1195
1195
else :
1196
1196
self ._drawn_artists = self ._init_func ()
1197
1197
if self ._blit :
1198
+ if self ._drawn_artists is None :
1199
+ raise RuntimeError ('The init_func must return a '
1200
+ 'sequence of Artist objects.' )
1198
1201
for a in self ._drawn_artists :
1199
1202
a .set_animated (self ._blit )
1200
1203
self ._save_seq = []
@@ -1211,5 +1214,8 @@ def _draw_frame(self, framedata):
1211
1214
# func needs to return a sequence of any artists that were modified.
1212
1215
self ._drawn_artists = self ._func (framedata , * self ._args )
1213
1216
if self ._blit :
1217
+ if self ._drawn_artists is None :
1218
+ raise RuntimeError ('The animation function must return a '
1219
+ 'sequence of Artist objects.' )
1214
1220
for a in self ._drawn_artists :
1215
1221
a .set_animated (self ._blit )
0 commit comments