diff options
Diffstat (limited to 'python/qpid/codec010.py')
-rw-r--r-- | python/qpid/codec010.py | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/python/qpid/codec010.py b/python/qpid/codec010.py index 94a1cd4263..0846db6bf7 100644 --- a/python/qpid/codec010.py +++ b/python/qpid/codec010.py @@ -17,7 +17,7 @@ # under the License. # -import datetime, string +import datetime from packer import Packer from datatypes import serial, timestamp, RangedSet, Struct, UUID from ops import Compound, PRIMITIVE, COMPOUND @@ -241,20 +241,15 @@ class Codec(Packer): v = sc.read_primitive(type) result[k] = v return result - - def _write_map_elem(self, k, v): - type = self.encoding(v) - sc = StringCodec() - sc.write_str8(k) - sc.write_uint8(type.CODE) - sc.write_primitive(type, v) - return sc.encoded - def write_map(self, m): sc = StringCodec() if m is not None: sc.write_uint32(len(m)) - sc.write(string.joinfields(map(self._write_map_elem, m.keys(), m.values()), "")) + for k, v in m.items(): + type = self.encoding(v) + sc.write_str8(k) + sc.write_uint8(type.CODE) + sc.write_primitive(type, v) self.write_vbin32(sc.encoded) def read_array(self): |