Skip to content

Commit fd41efc

Browse files
committed
Silence context for blitting type check exception.
The `iter` call is specifically to check the type, so including it as traceback context is confusing. The `RuntimeError` we raise is the intended error, and the internal exception is just flow control.
1 parent f794206 commit fd41efc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/animation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1723,13 +1723,13 @@ def _draw_frame(self, framedata):
17231723

17241724
if self._blit:
17251725

1726-
err = RuntimeError('The animation function must return a '
1727-
'sequence of Artist objects.')
1726+
err = RuntimeError('The animation function must return a sequence '
1727+
'of Artist objects.')
17281728
try:
17291729
# check if a sequence
17301730
iter(self._drawn_artists)
17311731
except TypeError:
1732-
raise err
1732+
raise err from None
17331733

17341734
# check each item if is artist
17351735
for i in self._drawn_artists:

0 commit comments

Comments
 (0)