Fix `roundtripped` ref error in `validate_payload_msg()`

py313_support
Tyler Goodlet 2025-03-03 12:19:11 -05:00
parent e8eec89f46
commit 7e1ad860cd
1 changed files with 7 additions and 2 deletions

View File

@ -796,6 +796,7 @@ def validate_payload_msg(
__tracebackhide__: bool = hide_tb __tracebackhide__: bool = hide_tb
codec: MsgCodec = current_codec() codec: MsgCodec = current_codec()
msg_bytes: bytes = codec.encode(pld_msg) msg_bytes: bytes = codec.encode(pld_msg)
roundtripped: Started|None = None
try: try:
roundtripped: Started = codec.decode(msg_bytes) roundtripped: Started = codec.decode(msg_bytes)
ctx: Context = getattr(ipc, 'ctx', ipc) ctx: Context = getattr(ipc, 'ctx', ipc)
@ -832,9 +833,13 @@ def validate_payload_msg(
verb_header='Trying to send ', verb_header='Trying to send ',
is_invalid_payload=True, is_invalid_payload=True,
) )
except BaseException: except BaseException as _be:
if not roundtripped:
raise verr
be = _be
__tracebackhide__: bool = False __tracebackhide__: bool = False
raise raise be
if not raise_mte: if not raise_mte:
return mte return mte