diff --git a/gajim/common/zeroconf/zeroconf_avahi.py b/gajim/common/zeroconf/zeroconf_avahi.py index ec31a7beb..22d198b36 100644 --- a/gajim/common/zeroconf/zeroconf_avahi.py +++ b/gajim/common/zeroconf/zeroconf_avahi.py @@ -89,7 +89,7 @@ class Zeroconf: if not self.connected: return if name != self.name: - for key in self.contacts: + for key in self.contacts.keys(): # pylint: disable=C0201 val = self.contacts[key] if val[Constant.BARE_NAME] == name: # try to reduce instead of delete first diff --git a/gajim/common/zeroconf/zeroconf_bonjour.py b/gajim/common/zeroconf/zeroconf_bonjour.py index 82a5d1c43..04eb307ac 100644 --- a/gajim/common/zeroconf/zeroconf_bonjour.py +++ b/gajim/common/zeroconf/zeroconf_bonjour.py @@ -98,7 +98,7 @@ class Zeroconf: if not self.connected: return if name != self.name: - for key in self.contacts: + for key in self.contacts.keys(): # pylint: disable=C0201 if self.contacts[key][Constant.NAME] == name: del self.contacts[key] self.remove_serviceCB(key) diff --git a/gajim/message_window.py b/gajim/message_window.py index 6a30a116b..e6663155e 100644 --- a/gajim/message_window.py +++ b/gajim/message_window.py @@ -1107,7 +1107,7 @@ class MessageWindowMgr(GObject.GObject): return False def _on_window_destroy(self, win): - for k in self._windows: + for k in self._windows.keys(): # pylint: disable=C0201 if self._windows[k].window == win: self.emit('window-delete', self._windows[k]) del self._windows[k]