~martijnbraam/bare-py

5fc77f71382745d9e5f3c81a89572c7fde83d227 — Martijn Braam 4 months ago aa800e7
Conform to the draft RFC
1 files changed, 4 insertions(+), 1 deletions(-)

M bare/__init__.py
M bare/__init__.py => bare/__init__.py +4 -1
@@ 124,7 124,10 @@ def _unpack_primitive(primitive, data, offset):
    elif primitive.type == TypeKind.F64:
        return struct.unpack_from('<d', data, offset)[0], offset + 8
    elif primitive.type == TypeKind.Bool:
        return struct.unpack_from('<?', data, offset)[0], offset + 1
        temp = struct.unpack_from('<B', data, offset)[0], offset + 1
        if temp > 1:
            raise ValueError("Encountered bool set field with an invalud value at {}".format(offset))
        return temp == 1
    elif primitive.type == TypeKind.Void:
        return None, offset
    elif primitive.type == TypeKind.String or primitive.type == TypeKind.Data: