diff options
author | Omer Katz <omer.drow@gmail.com> | 2019-02-28 11:57:25 +0200 |
---|---|---|
committer | Omer Katz <omer.drow@gmail.com> | 2019-02-28 11:57:25 +0200 |
commit | d870214cb9e0b754b66cdcb3df785a6fa823e145 (patch) | |
tree | 263fdb451172b736dc36080a41ca6fc86b31f934 /amqp/serialization.py | |
parent | ed759687c069b12c914d8ebdab26ef34d068fca9 (diff) | |
download | py-amqp-fix-bitmap-parsing.tar.gz |
The bitcount will reset only when we move to the next byte.fix-bitmap-parsing
Add a test to verify that parsing two consecutive bitmaps does not fail.
Diffstat (limited to 'amqp/serialization.py')
-rw-r--r-- | amqp/serialization.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/amqp/serialization.py b/amqp/serialization.py index 183ae2e..758a3c0 100644 --- a/amqp/serialization.py +++ b/amqp/serialization.py @@ -172,11 +172,10 @@ def loads(format, buf, offset=0, if not bitcount: bits = ord(buf[offset:offset + 1]) offset += 1 - bitcount = 8 + bitcount = 8 val = (bits & 1) == 1 bits >>= 1 bitcount -= 1 - elif p == 'o': bitcount = bits = 0 val, = unpack_from('>B', buf, offset) |