Skip to content

Commit

Permalink
StandardLengthType: only bail out when encountering compressed masks …
Browse files Browse the repository at this point in the history
…when in strict mode

as usual, we will soldier on in non-strict mode, but the results will
be undefined...

Signed-off-by: Andreas Lauser <[email protected]>
Signed-off-by: Katja Köhler <[email protected]>
  • Loading branch information
andlaus committed Apr 25, 2024
1 parent dcc46f9 commit d1bf470
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion odxtools/standardlengthtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ def __apply_mask(self, internal_value: AtomicOdxType) -> AtomicOdxType:
if self.bit_mask is None:
return internal_value
if self.is_condensed_raw is True:
raise NotImplementedError("Serialization of condensed bit mask is not supported")
odxraise("Serialization of condensed bit mask is not supported",
NotImplementedError)
return
if isinstance(internal_value, int):
return internal_value & self.bit_mask
if isinstance(internal_value, bytes):
Expand Down

0 comments on commit d1bf470

Please sign in to comment.