Commit b7dd5205 authored by Jameson Rollins's avatar Jameson Rollins

missed python3 fixes

parent 330219b5
......@@ -346,7 +346,7 @@ class Database(object):
self._cas = cas
self._db = {}
self._writable = []
for channel, entry in guarddb.iteritems():
for channel, entry in guarddb.items():
self._db[channel] = None
if entry.get('writable', False):
self._writable.append(channel)
......
......@@ -390,7 +390,7 @@ class NodeManager(object):
def __iter__(self):
"""Iterator of node objects."""
for node in self.nodes.itervalues():
for node in self.nodes.values():
yield node
def init(self):
......
......@@ -38,7 +38,7 @@ class SharedMemString(object):
@property
def value(self):
return str(self._sm.raw.strip('\0'))
return self._sm.value.decode()
@value.setter
def value(self, value):
......@@ -47,8 +47,4 @@ class SharedMemString(object):
def set_value(self, value=''):
value = str(value)
size = self._size
# HACK: string formatting bug in python 2.7.3 prevents filling
# with null characters. This appears to be fixed in python
# 2.7.8
#self._sm.value = '{:\0<{size}}'.format(value[:size], size=size)
self._sm.value = value[:size] + '\0'*(size - len(value))
self._sm.value = '{:\0<{size}}'.format(value[:size], size=size).encode()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment