mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-26 14:22:06 +00:00
refactor(core/python): update and unify type ignore statements
[no changelog]
This commit is contained in:
parent
834d556b9c
commit
f9ccced691
@ -60,7 +60,7 @@ def exception(name: str, exc: BaseException) -> None:
|
|||||||
name,
|
name,
|
||||||
_DEBUG,
|
_DEBUG,
|
||||||
"ui.Result: %s",
|
"ui.Result: %s",
|
||||||
exc.value, # type: ignore[Cannot access attribute "value" for class "BaseException"]
|
exc.value, # type: ignore [Cannot access attribute "value" for class "BaseException"]
|
||||||
)
|
)
|
||||||
elif exc.__class__.__name__ == "Cancelled":
|
elif exc.__class__.__name__ == "Cancelled":
|
||||||
_log(name, _DEBUG, "ui.Cancelled")
|
_log(name, _DEBUG, "ui.Cancelled")
|
||||||
|
@ -64,7 +64,7 @@ def raise_if_not_confirmed(
|
|||||||
exc: ExceptionType = ActionCancelled,
|
exc: ExceptionType = ActionCancelled,
|
||||||
) -> Awaitable[None]:
|
) -> Awaitable[None]:
|
||||||
action = interact(layout_obj, br_name, br_code, exc)
|
action = interact(layout_obj, br_name, br_code, exc)
|
||||||
return action # type: ignore ["UiResult" is incompatible with "None"]
|
return action # type: ignore [Expression of type "Coroutine[Any, Any, UiResult]" is incompatible with return type "Awaitable[None]"]
|
||||||
|
|
||||||
|
|
||||||
async def with_info(
|
async def with_info(
|
||||||
|
@ -1114,7 +1114,7 @@ def request_passphrase_on_device(max_len: int) -> Awaitable[str]:
|
|||||||
ButtonRequestType.PassphraseEntry,
|
ButtonRequestType.PassphraseEntry,
|
||||||
raise_on_cancel=ActionCancelled("Passphrase entry cancelled"),
|
raise_on_cancel=ActionCancelled("Passphrase entry cancelled"),
|
||||||
)
|
)
|
||||||
return result # type: ignore ["UiResult" is incompatible with "str"]
|
return result # type: ignore [Expression of type "Coroutine[Any, Any, str | UiResult]" is incompatible with return type "Awaitable[str]"]
|
||||||
|
|
||||||
|
|
||||||
def request_pin_on_device(
|
def request_pin_on_device(
|
||||||
@ -1143,7 +1143,7 @@ def request_pin_on_device(
|
|||||||
ButtonRequestType.PinEntry,
|
ButtonRequestType.PinEntry,
|
||||||
raise_on_cancel=PinCancelled,
|
raise_on_cancel=PinCancelled,
|
||||||
)
|
)
|
||||||
return result # type: ignore ["UiResult" is incompatible with "str"]
|
return result # type: ignore [Expression of type "Coroutine[Any, Any, str | UiResult]" is incompatible with return type "Awaitable[str]"]
|
||||||
|
|
||||||
|
|
||||||
async def confirm_reenter_pin(is_wipe_code: bool = False) -> None:
|
async def confirm_reenter_pin(is_wipe_code: bool = False) -> None:
|
||||||
|
@ -1258,7 +1258,7 @@ def pin_mismatch_popup(is_wipe_code: bool = False) -> Awaitable[None]:
|
|||||||
TR.buttons__check_again,
|
TR.buttons__check_again,
|
||||||
br_code=BR_CODE_OTHER,
|
br_code=BR_CODE_OTHER,
|
||||||
)
|
)
|
||||||
return layout # type: ignore ["UiResult" is incompatible with "None"]
|
return layout # type: ignore [Expression of type "Awaitable[UiResult]" is incompatible with return type "Awaitable[None]"]
|
||||||
|
|
||||||
|
|
||||||
def wipe_code_same_as_pin_popup() -> Awaitable[None]:
|
def wipe_code_same_as_pin_popup() -> Awaitable[None]:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from typing import Awaitable, Sequence
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import trezorui2
|
import trezorui2
|
||||||
from trezor import TR
|
from trezor import TR
|
||||||
@ -9,6 +9,11 @@ from . import confirm_action, show_success, show_warning
|
|||||||
|
|
||||||
CONFIRMED = trezorui2.CONFIRMED # global_import_cache
|
CONFIRMED = trezorui2.CONFIRMED # global_import_cache
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from typing import Awaitable, Sequence
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
async def show_share_words(
|
async def show_share_words(
|
||||||
share_words: Sequence[str],
|
share_words: Sequence[str],
|
||||||
|
Loading…
Reference in New Issue
Block a user