Skip to content

Commit

Permalink
Merge pull request #2 from nickpiggott/master
Browse files Browse the repository at this point in the history
Fixed problem with long CData strings
  • Loading branch information
nickpiggott authored Jul 22, 2020
2 parents 452996f + d3ddfdc commit f73d6cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/spi/binary/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,13 +672,13 @@ def tobytes(self):
bits += tmp
elif datalength >= 254 and datalength <= 1<<16:
tmp = bitarray()
tmp.fromstring('\xfe')
tmp.frombytes'\xfe')
bits += tmp
tmp = encode_number(datalength, 16)
bits += tmp
elif datalength > 1<<16 and datalength <= 1<<24:
tmp = bitarray()
tmp.fromstring('\xff')
tmp.frombytes('\xff')
bits += tmp
tmp = encode_number(datalength, 24)
bits += tmp
Expand Down

0 comments on commit f73d6cc

Please sign in to comment.