1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-15 19:08:07 +00:00

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"
This commit is contained in:
matejcik 2024-07-18 11:44:50 +02:00 committed by matejcik
parent 98dde40729
commit 1fc7d41b8d

View File

@ -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: