8000 Backport PR #20916 on branch v3.5.x (Improve deleted Animation warning) by meeseeksmachine · Pull Request #20933 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Backport PR #20916 on branch v3.5.x (Improve deleted Animation warning) #20933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/matplotlib/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,9 +888,11 @@ def __del__(self):
if not getattr(self, '_draw_was_started', True):
warnings.warn(
'Animation was deleted without rendering anything. This is '
'most likely unintended. To prevent deletion, assign the '
'Animation to a variable that exists for as long as you need '
'the Animation.')
'most likely not intended. To prevent deletion, assign the '
'Animation to a variable, e.g. `anim`, that exists until you '
'have outputted the Animation using `plt.show()` or '
'`anim.save()`.'
)

def _start(self, *args):
"""
Expand Down
0