Don't log on_focus_changed warning if new is None

This commit is contained in:
Florian Bruhin 2016-07-26 23:27:20 +02:00
parent 2121865bdd
commit cd905841e0

View File

@ -339,7 +339,7 @@ def _save_version():
def on_focus_changed(_old, new):
"""Register currently focused main window in the object registry."""
if not isinstance(new, QWidget):
if not isinstance(new, QWidget) and new is not None:
log.misc.debug("on_focus_changed called with non-QWidget {!r}".format(
new))