Skip to content

Commit

Permalink
Fix up cpyamf
Browse files Browse the repository at this point in the history
  • Loading branch information
njoyce committed Nov 25, 2010
1 parent fba182a commit f215298
Show file tree
Hide file tree
Showing 6 changed files with 2,594 additions and 2,709 deletions.
873 changes: 490 additions & 383 deletions cpyamf/amf0.c

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions cpyamf/amf0.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,9 @@ cdef class Encoder(codec.Encoder):
@param o: The C{dict} data to be encoded to the AMF0 data stream.
"""
for key, value in attrs.iteritems():
if PyInt_Check(key) or PyLong_Check(key):
key = str(key)

self.serialiseString(key)
self.writeElement(value)

Expand Down
2,078 changes: 1,082 additions & 996 deletions cpyamf/amf3.c

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions cpyamf/amf3.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,9 @@ cdef class Encoder(codec.Encoder):
self.stream.write(&REF_CHAR, 1)

for key, value in obj.iteritems():
if PyInt_Check(key) or PyLong_Check(key):
key = str(key)

self.serialiseString(key)
self.writeElement(value)

Expand Down
Loading

0 comments on commit f215298

Please sign in to comment.