Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a0b2949

Browse files
QuLogicmeeseeksmachine
authored andcommitted
Backport PR #19597: Fix IPython import issue
1 parent 25515bc commit a0b2949

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,7 @@ def _fix_ipython_backend2gui(cls):
17431743
# `ipython --auto`). This cannot be done at import time due to
17441744
# ordering issues, so we do it when creating a canvas, and should only
17451745
# be done once per class (hence the `lru_cache(1)`).
1746-
if "IPython" not in sys.modules:
1746+
if sys.modules.get("IPython") is None:
17471747
return
17481748
import IPython
17491749
ip = IPython.get_ipython()

0 commit comments

Comments
 (0)