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

Skip to content

Commit 0eaa2db

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 a4ffb68 commit 0eaa2db

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
@@ -2244,8 +2244,8 @@ def getname_val(identifier):
22442244
# requested, ignore rcParams['backend'] and force selection of a backend that
22452245
# is compatible with the current running interactive framework.
22462246
if (rcParams["backend_fallback"]
2247-
and dict.__getitem__(rcParams, "backend") in [
2248-
k for k in _interactive_bk if k not in ['WebAgg', 'nbAgg']]
2247+
and dict.__getitem__(rcParams, "backend") in (
2248+
set(_interactive_bk) - {'WebAgg', 'nbAgg'})
22492249
and cbook._get_running_interactive_framework()):
22502250
dict.__setitem__(rcParams, "backend", rcsetup._auto_backend_sentinel)
22512251
# Set up the backend.

0 commit comments

Comments
 (0)