From 6aaa675e4b0d56dda0563cb1cdd2abfe0777829c Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 22 Jun 2020 15:51:18 -0400 Subject: [PATCH] Backport PR #17720: Fix check for manager = None. --- lib/matplotlib/backend_bases.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index 37d7d276ea93..5bdcb6c6a64f 100644 --- a/lib/matplotlib/backend_bases.py +++ b/lib/matplotlib/backend_bases.py @@ -2233,7 +2233,7 @@ def get_window_title(self): Return the title text of the window containing the figure, or None if there is no window (e.g., a PS backend). """ - if self.manager: + if self.manager is not None: return self.manager.get_window_title() def set_window_title(self, title): @@ -2241,7 +2241,7 @@ def set_window_title(self, title): Set the title text of the window containing the figure. Note that this has no effect if there is no window (e.g., a PS backend). """ - if hasattr(self, "manager"): + if self.manager is not None: self.manager.set_window_title(title) def get_default_filename(self):