1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-14 03:30:02 +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 M1nd3r
parent 38b1151673
commit d24ea3ca7d

View File

@ -216,6 +216,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: