diff --git a/bindings/python/iota_sdk/types/payload.py b/bindings/python/iota_sdk/types/payload.py index 5d44e1759f..3870ec3316 100644 --- a/bindings/python/iota_sdk/types/payload.py +++ b/bindings/python/iota_sdk/types/payload.py @@ -153,10 +153,9 @@ class TaggedDataPayload(Payload): init=True) def __post_init__(self): - if self.type != int( - PayloadType.TaggedData): - return dacite.UnionMatchError("invalid TaggedDataPayload type", self) - return self + if self.type != PayloadType.TaggedData: + raise dacite.UnionMatchError( + "invalid TaggedDataPayload type", self) @dataclass