Skip to content

Commit 4f23bc8

Browse files
committed
this one syntax change makes it work in Python 2.6
NOBODY SHOULD BE USING PYTHON 2.6
1 parent 5d4f1ad commit 4f23bc8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cbor/tagmap.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ def encode(self, obj):
5151
return [self.encode(x) for x in obj]
5252
if isinstance(obj, dict):
5353
# assume key is a primitive
54-
return {k:self.encode(v) for k,v in obj.iteritems()}
54+
# can't do this in Python 2.6:
55+
#return {k:self.encode(v) for k,v in obj.iteritems()}
56+
out = {}
57+
for k,v in obj.iteritems():
58+
out[k] = self.encode(v)
59+
return out
5560
# fall through, let underlying cbor.dump decide if it can encode object
5661
return obj
5762

0 commit comments

Comments
 (0)