Skip to content

Commit 5ebb5f9

Browse files
committed
MNT: simplify string comparison
1 parent 893134f commit 5ebb5f9

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
@@ -324,8 +324,7 @@ def draw_if_interactive():
324324
# Need to keep a global reference to the backend for compatibility reasons.
325325
# See https://github.com/matplotlib/matplotlib/issues/6092
326326
matplotlib.backends.backend = newbackend
327-
if not (isinstance(old_backend, str) and
328-
old_backend.lower() == newbackend.lower()):
327+
if not cbook._str_equal(old_backend, newbackend):
329328
close("all")
330329

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

0 commit comments

Comments
 (0)