1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-04 13:52:35 +00:00

fixup! feat(python): use dbus-next for BLE

This commit is contained in:
Martin Milata 2023-06-28 23:19:43 +02:00 committed by tychovrahe
parent 5a70cce86d
commit 70d16d4523

View File

@ -21,7 +21,7 @@ from typing import TYPE_CHECKING, Any, Callable, Dict, Optional
import click import click
from .. import exceptions, transport from .. import exceptions, messages, transport
from ..client import TrezorClient from ..client import TrezorClient
from ..ui import ClickUI, ScriptUI from ..ui import ClickUI, ScriptUI
@ -104,6 +104,12 @@ class TrezorConnection:
except transport.DeviceIsBusy: except transport.DeviceIsBusy:
click.echo("Device is in use by another process.") click.echo("Device is in use by another process.")
sys.exit(1) sys.exit(1)
except exceptions.TrezorFailure as e:
if e.code is messages.FailureType.DeviceIsBusy:
click.echo(str(e))
sys.exit(1)
else:
raise e
except Exception: except Exception:
click.echo("Failed to find a Trezor device.") click.echo("Failed to find a Trezor device.")
if self.path is not None: if self.path is not None: