From 1fc7d41b8d85015c717d97f89c3d8415795063e1 Mon Sep 17 00:00:00 2001 From: matejcik Date: Thu, 18 Jul 2024 11:44:50 +0200 Subject: [PATCH] fix(core): set default value for do_not_restart otherwise if _handle_single_message raises an exception (which is fortunately not something that should generally happen), the finally-block would fail on "referenced before assignment" --- core/src/trezor/wire/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/trezor/wire/__init__.py b/core/src/trezor/wire/__init__.py index a2c5127567..df5ee77377 100644 --- a/core/src/trezor/wire/__init__.py +++ b/core/src/trezor/wire/__init__.py @@ -214,6 +214,7 @@ async def handle_session(iface: WireInterface, session_id: int) -> None: msg = next_msg next_msg = None + do_not_restart = False try: do_not_restart = await _handle_single_message(ctx, msg) except context.UnexpectedMessage as unexpected: