MCPcopy Create free account
hub / github.com/Bitmessage/PyBitmessage / _unpack_array

Function _unpack_array

src/fallback/umsgpack/umsgpack.py:716–726  ·  view source on GitHub ↗
(code, fp, options)

Source from the content-addressed store, hash-verified

714
715
716def _unpack_array(code, fp, options):
717 if (ord(code) & 0xf0) == 0x90:
718 length = (ord(code) & ~0xf0)
719 elif code == b'\xdc':
720 length = struct.unpack(">H", _read_except(fp, 2))[0]
721 elif code == b'\xdd':
722 length = struct.unpack(">I", _read_except(fp, 4))[0]
723 else:
724 raise Exception("logic error, not array: 0x%02x" % ord(code))
725
726 return [_unpack(fp, options) for i in xrange(length)]
727
728
729def _deep_list_to_tuple(obj):

Callers

nothing calls this directly

Calls 2

_read_exceptFunction · 0.85
_unpackFunction · 0.85

Tested by

no test coverage detected