keys() doesnt return list() in python3

This commit is contained in:
Philipp Hörist 2018-09-18 07:20:49 +02:00
parent 206b87d7b7
commit cbe335b291
3 changed files with 3 additions and 3 deletions

View File

@ -89,7 +89,7 @@ class Zeroconf:
if not self.connected: if not self.connected:
return return
if name != self.name: if name != self.name:
for key in self.contacts.keys(): # pylint: disable=C0201 for key in list(self.contacts.keys()):
val = self.contacts[key] val = self.contacts[key]
if val[Constant.BARE_NAME] == name: if val[Constant.BARE_NAME] == name:
# try to reduce instead of delete first # try to reduce instead of delete first

View File

@ -98,7 +98,7 @@ class Zeroconf:
if not self.connected: if not self.connected:
return return
if name != self.name: if name != self.name:
for key in self.contacts.keys(): # pylint: disable=C0201 for key in list(self.contacts.keys()):
if self.contacts[key][Constant.NAME] == name: if self.contacts[key][Constant.NAME] == name:
del self.contacts[key] del self.contacts[key]
self.remove_serviceCB(key) self.remove_serviceCB(key)

View File

@ -1107,7 +1107,7 @@ class MessageWindowMgr(GObject.GObject):
return False return False
def _on_window_destroy(self, win): def _on_window_destroy(self, win):
for k in self._windows.keys(): # pylint: disable=C0201 for k in list(self._windows.keys()):
if self._windows[k].window == win: if self._windows[k].window == win:
self.emit('window-delete', self._windows[k]) self.emit('window-delete', self._windows[k])
del self._windows[k] del self._windows[k]