From 00d40237cbec54dc3f34975b8035036c2b80405c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thoralf=20M=C3=BCller?= Date: Wed, 14 Feb 2024 14:59:24 +0100 Subject: [PATCH] Raise error --- bindings/python/iota_sdk/types/payload.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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