8000 FIX: pyplot auto-backend detection case-sensitivity fixup · matplotlib/matplotlib@b07d9c6 · GitHub
[go: up one dir, main page]

Skip to content

Commit b07d9c6

Browse files
committed
FIX: pyplot auto-backend detection case-sensitivity fixup
(cherry picked from commit f45707d)
1 parent 2b61d2b commit b07d9c6

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

lib/matplotlib/pyplot.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2715,12 +2715,15 @@ def polar(*args, **kwargs) -> list[Line2D]:
27152715
# If rcParams['backend_fallback'] is true, and an interactive backend is
27162716
# requested, ignore rcParams['backend'] and force selection of a backend that
27172717
# is compatible with the current running interactive framework.
2718-
if (rcParams["backend_fallback"]
2719-
and rcParams._get_backend_or_none() in ( # type: ignore[attr-defined]
2720-
set(backend_registry.list_builtin(BackendFilter.INTERACTIVE)) -
2721-
{'webagg', 'nbagg'})
2722-
and cbook._get_running_interactive_framework()):
2723-
rcParams._set("backend", rcsetup._auto_backend_sentinel)
2718+
if rcParams["backend_fallback"]:
2719+
requested_backend = rcParams._get_backend_or_none() # type: ignore[attr-defined]
2720+
requested_backend = None if requested_backend is None else requested_backend.lower()
2721+
available_backends = backend_registry.list_builtin(BackendFilter.INTERACTIVE)
2722+
if (
2723+
requested_backend in (set(available_backends) - {'webagg', 'nbagg'})
2724+
and cbook._get_running_interactive_framework()
2725+
):
2726+
rcParams._set("backend", rcsetup._auto_backend_sentinel)
27242727

27252728
# fmt: on
27262729

0 commit comments

Comments
 (0)
0