Skip to content

Commit 44c34b2

Browse files
tacaswellmelissawm
authored andcommitted
MNT: simplify string comparison
1 parent 7bcdaf3 commit 44c34b2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/matplotlib/pyplot.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,7 @@ def draw_if_interactive():
326326
# Need to keep a global reference to the backend for compatibility reasons.
327327
# See https://github.com/matplotlib/matplotlib/issues/6092
328328
matplotlib.backends.backend = newbackend
329-
if not (isinstance(old_backend, str) and
330-
old_backend.lower() == newbackend.lower()):
329+
if not cbook._str_equal(old_backend, newbackend):
331330
close("all")
332331

333332
# make sure the repl display hook is installed in case we become

0 commit comments

Comments
 (0)