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

Do not trigger backend auto-resolution #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions matplotlib_inline/backend_inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ def configure_inline_support(shell, backend):

def _enable_matplotlib_integration():
"""Enable extra IPython matplotlib integration when we are loaded as the matplotlib backend."""
from matplotlib import get_backend
from matplotlib import _get_backend_or_none
Copy link
Member

Choose a reason for hiding this comment

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

The problem I see with this approach is that you're using a private function for it. So, if Matplotlib API changes in the future, this would break.

Pinging @tacaswell about it to see what he thinks.

ip = get_ipython()
backend = get_backend()
backend = _get_backend_or_none()
if ip and backend == 'module://%s' % __name__:
from IPython.core.pylabtools import activate_matplotlib
try:
Expand Down