diff --git a/packages/smithy-aws-event-stream/src/smithy_aws_event_stream/_private/serializers.py b/packages/smithy-aws-event-stream/src/smithy_aws_event_stream/_private/serializers.py index a96d38b5c..63e2b0ac1 100644 --- a/packages/smithy-aws-event-stream/src/smithy_aws_event_stream/_private/serializers.py +++ b/packages/smithy-aws-event-stream/src/smithy_aws_event_stream/_private/serializers.py @@ -59,10 +59,8 @@ def begin_struct(self, schema: "Schema") -> Iterator[ShapeSerializer]: # Note that if we're serializing an operation input or output, it won't be a # union at all, so this won't get triggered. Thankfully, that's what we want. if schema.shape_type is ShapeType.UNION: - try: - yield self - finally: - return + yield self + return headers: dict[str, HEADER_VALUE] = {}