Skip to content
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

Guard against ipympl.backend_nbagg being imported outside of an IPython context #364

Merged
merged 1 commit into from Sep 28, 2021

Conversation

pelson
Copy link
Member

@pelson pelson commented Sep 27, 2021

Closes #363

$ python -c "import ipympl.backend_nbagg"; echo $?
0

@github-actions
Copy link
Contributor

Binder 👈 Launch a binder notebook on branch pelson/ipympl/fix/no_ipy_import

@@ -428,4 +428,5 @@ def flush_figures():


ip = get_ipython()
ip.events.register('post_execute', flush_figures)
if ip is not None:
Copy link
Member Author

Choose a reason for hiding this comment

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

Happy to add a comment / context about why this exists, if useful?

@martinRenou
Copy link
Member

martinRenou commented Sep 27, 2021

Thanks a lot for the PR! CI failures are unrelated, we should fix them in a separate PR

@martinRenou martinRenou merged commit 0bdcd00 into matplotlib:master Sep 28, 2021
@pelson pelson deleted the fix/no_ipy_import branch September 28, 2021 07:03
@pelson
Copy link
Member Author

pelson commented Sep 28, 2021

Thanks for the quick response to the issue, and getting this merged so quickly. 👍

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.

No longer able to import ipympl.nbagg_backend
2 participants