There was an error while loading. Please reload this page.
1 parent 5d4f1ad commit 4f23bc8Copy full SHA for 4f23bc8
cbor/tagmap.py
@@ -51,7 +51,12 @@ def encode(self, obj):
51
return [self.encode(x) for x in obj]
52
if isinstance(obj, dict):
53
# assume key is a primitive
54
- return {k:self.encode(v) for k,v in obj.iteritems()}
+ # 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
60
# fall through, let underlying cbor.dump decide if it can encode object
61
return obj
62
0 commit comments