File tree 1 file changed +9
-8
lines changed
1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -211,14 +211,15 @@ def switch_backend(newbackend):
211
211
newbackend , Backend .backend_version )
212
212
213
213
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 ))
222
223
223
224
rcParams ['backend' ] = rcParamsDefault ['backend' ] = newbackend
224
225
You can’t perform that action at this time.
0 commit comments