1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-24 13:22:05 +00:00

Fix SyntaxError - SESSIONLESS_FLAG cannot be used as a constant when imported

This commit is contained in:
M1nd3r 2024-03-11 11:42:16 +01:00 committed by M1nd3r
parent 014cca8bac
commit 6d22f362e5
2 changed files with 4 additions and 6 deletions

View File

@ -4,7 +4,9 @@ from micropython import const
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from trezor import utils from trezor import utils
from storage.cache_common import SESSIONLESS_FLAG, InvalidSessionError, SessionlessCache from storage.cache_common import InvalidSessionError, SessionlessCache
SESSIONLESS_FLAG = const(128)
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Sequence, TypeVar, overload from typing import Sequence, TypeVar, overload

View File

@ -1,4 +1,3 @@
from micropython import const
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from trezor import utils from trezor import utils
@ -8,8 +7,6 @@ if TYPE_CHECKING:
T = TypeVar("T") T = TypeVar("T")
SESSIONLESS_FLAG = const(128)
class InvalidSessionError(Exception): class InvalidSessionError(Exception):
pass pass
@ -30,8 +27,7 @@ class DataCache:
if TYPE_CHECKING: if TYPE_CHECKING:
@overload @overload
def get(self, key: int) -> bytes | None: def get(self, key: int) -> bytes | None: ...
...
@overload @overload
def get(self, key: int, default: T) -> bytes | T: # noqa: F811 def get(self, key: int, default: T) -> bytes | T: # noqa: F811