@@ -93,6 +93,9 @@ def __init__(self):
93
93
}
94
94
95
95
def _backend_module_name (self , backend ):
96
+ if backend .startswith ("module://" ):
97
+ return backend [9 :]
98
+
96
99
# Return name of module containing the specified backend.
97
100
# Does not check if the backend is valid, use is_valid_backend for that.
98
101
backend = backend .lower ()
@@ -224,7 +227,8 @@ def is_valid_backend(self, backend):
224
227
bool
225
228
True if backend is valid, False otherwise.
226
229
"""
227
- backend = backend .lower ()
230
+ if not backend .startswith ("module://" ):
231
+ backend = backend .lower ()
228
232
229
233
# For backward compatibility, convert ipympl and matplotlib-inline long
230
234
# module:// names to their shortened forms.
@@ -342,7 +346,8 @@ def resolve_backend(self, backend):
342
346
The GUI framework, which will be None for a backend that is non-interactive.
343
347
"""
344
348
if isinstance (backend , str ):
345
- backend = backend .lower ()
349
+ if not backend .startswith ("module://" ):
350
+ backend = backend .lower ()
346
351
else : # Might be _auto_backend_sentinel or None
347
352
# Use whatever is already running...
348
353
from matplotlib import get_backend
@@ -395,7 +400,8 @@ def resolve_gui_or_backend(self, gui_or_backend):
395
400
framework : str or None
396
401
The GUI framework, which will be None for a backend that is non-interactive.
397
402
"""
398
- gui_or_backend = gui_or_backend .lower ()
403
+ if not gui_or_backend .startswith ("module://" ):
404
+ gui_or_backend = gui_or_backend .lower ()
399
405
400
406
# First check if it is a gui loop name.
401
407
backend = self .backend_for_gui_framework (gui_or_backend )
0 commit comments