Skip to content

Fix stray plt.close when generating baselines #66

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
merged 2 commits into from
Feb 18, 2018
Merged

Fix stray plt.close when generating baselines #66

merged 2 commits into from
Feb 18, 2018

Conversation

leouieda
Copy link
Contributor

When generating baselines, was calling plt.close without checking if it's a matplotlib Figure first. Fix this and refactor the code figure closing code into a function to get rid of duplication.

When generating baselines, was calling plt.close without checking if
it's a matplotlib Figure. Fix this and put the check + close code in a
function to get rid of duplication.
Copy link
Collaborator

@astrofrog astrofrog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Can you rename _close_figure to close_mpl_figure? I don't think the underscore is really needed since users don't import this module explicitly anyway.

@leouieda
Copy link
Contributor Author

@astrofrog done

@astrofrog astrofrog merged commit ec779cb into matplotlib:master Feb 18, 2018
@leouieda leouieda deleted the close-figure branch February 18, 2018 21:47
@leouieda leouieda mentioned this pull request Sep 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants