Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 58b8743

Browse files
tacaswellQuLogic
andcommitted
MNT: use set rather than list comprehension to filter backend list
Co-Authored-By: Elliott Sales de Andrade <[email protected]>
1 parent 699ecad commit 58b8743

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2247,8 +2247,8 @@ def getname_val(identifier):
22472247
# requested, ignore rcParams['backend'] and force selection of a backend that
22482248
# is compatible with the current running interactive framework.
22492249
if (rcParams["backend_fallback"]
2250-
and dict.__getitem__(rcParams, "backend") in [
2251-
k for k in _interactive_bk if k not in ['WebAgg', 'nbAgg']]
2250+
and dict.__getitem__(rcParams, "backend") in (
2251+
set(_interactive_bk) - {'WebAgg', 'nbAgg'})
22522252
and cbook._get_running_interactive_framework()):
22532253
dict.__setitem__(rcParams, "backend", rcsetup._auto_backend_sentinel)
22542254
# Set up the backend.

0 commit comments

Comments
 (0)