Skip to content

Commit 69ba449

Browse files
committed
Remove unused _safe_pyplot_import
1 parent 7812db7 commit 69ba449

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -93,29 +93,6 @@
9393
}
9494

9595

96-
def _safe_pyplot_import():
97-
"""
98-
Import and return ``pyplot``, correctly setting the backend if one is
99-
already forced.
100-
"""
101-
try:
102-
import matplotlib.pyplot as plt
103-
except ImportError: # Likely due to a framework mismatch.
104-
current_framework = cbook._get_running_interactive_framework()
105-
if current_framework is None:
106-
raise # No, something else went wrong, likely with the install...
107-
108-
from matplotlib.backends import backend_registry
109-
backend = backend_registry.backend_for_gui_framework(current_framework)
110-
if backend is None:
111-
raise RuntimeError("No suitable backend for the current GUI framework "
112-
f"{current_framework!r}")
113-
114-
rcParams["backend"] = mpl.rcParamsOrig["backend"] = backend
115-
import matplotlib.pyplot as plt # Now this should succeed.
116-
return plt
117-
118-
11996
def register_backend(format, backend, description=None):
12097
"""
12198
Register a backend for saving to a given file format.

0 commit comments

Comments
 (0)