Port to six

This commit is contained in:
Aniket21mathur 2019-07-13 14:45:12 +05:30 committed by James Cameron
parent 3b28597486
commit ed46c219a9
3 changed files with 3 additions and 3 deletions

View File

@ -1503,7 +1503,7 @@ class _ClientHandler(dbus.service.Object):
def GetAll(self, interface_name): def GetAll(self, interface_name):
if interface_name in self._prop_getters: if interface_name in self._prop_getters:
r = {} r = {}
for k, v in self._prop_getters[interface_name].items(): for k, v in list(self._prop_getters[interface_name].items()):
r[k] = v() r[k] = v()
return r return r
else: else:

View File

@ -88,7 +88,7 @@ class DSMetadata(GObject.GObject):
self._properties = {} self._properties = {}
else: else:
if six.PY3: if six.PY3:
for x, y in properties.items(): for x, y in list(properties.items()):
try: try:
properties[x] = y.decode() properties[x] = y.decode()
except BaseException: except BaseException:

View File

@ -208,7 +208,7 @@ class LRU:
return iter(self.d) return iter(self.d)
def itervalues(self): def itervalues(self):
for i_, j in self.iteritems(): for i_, j in six.iteritems(self):
yield j yield j
def keys(self): def keys(self):