File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,14 +211,15 @@ def switch_backend(newbackend):
211211 newbackend , Backend .backend_version )
212212
213213 required_framework = Backend .required_interactive_framework
214- current_framework = \
215- matplotlib .backends ._get_running_interactive_framework ()
216- if (current_framework and required_framework
217- and current_framework != required_framework ):
218- raise ImportError (
219- "Cannot load backend {!r} which requires the {!r} interactive "
220- "framework, as {!r} is currently running" .format (
221- newbackend , required_framework , current_framework ))
214+ if required_framework is not None :
215+ current_framework = \
216+ matplotlib .backends ._get_running_interactive_framework ()
217+ if (current_framework and required_framework
218+ and current_framework != required_framework ):
219+ raise ImportError (
220+ "Cannot load backend {!r} which requires the {!r} interactive "
221+ "framework, as {!r} is currently running" .format (
222+ newbackend , required_framework , current_framework ))
222223
223224 rcParams ['backend' ] = rcParamsDefault ['backend' ] = newbackend
224225
You can’t perform that action at this time.
0 commit comments