From 51794ba2978415007e9c333ced023dbc0d949888 Mon Sep 17 00:00:00 2001 From: Adam Shapiro Date: Mon, 25 Mar 2024 18:26:44 -0400 Subject: [PATCH] Fixed incorrect default calcsize() for variable-sized messages. --- python/fusion_engine_client/messages/defs.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/python/fusion_engine_client/messages/defs.py b/python/fusion_engine_client/messages/defs.py index edd00ce8..6a00ef82 100644 --- a/python/fusion_engine_client/messages/defs.py +++ b/python/fusion_engine_client/messages/defs.py @@ -557,13 +557,8 @@ def unpack(self, buffer: bytes, offset: int = 0, message_version: int = _UNSPECI else: raise NotImplementedError('unpack() not implemented.') - @classmethod - def calcsize(cls) -> int: - construct = getattr(cls, 'Construct', None) - if construct is not None: - return construct.sizeof() - else: - raise NotImplementedError('calcsize() not implemented.') + def calcsize(self) -> int: + raise NotImplementedError('calcsize() not implemented.') def get_p1_time(self) -> Timestamp: measurement_details = getattr(self, 'details', None)