mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-26 01:18:28 +00:00
core: drop sys.pyi from mocks (fixes #934)
A change introduced in mypy 0.770 disallows overriding some system modules, including `sys`. We only need the override for `sys.print_exception`, and the simplest solution is to make mypy ignore that particular call.
This commit is contained in:
parent
17392f94b8
commit
eec0615444
@ -1,16 +0,0 @@
|
||||
from typing import *
|
||||
|
||||
def exit(retval: Any = ...) -> None:
|
||||
raise SystemExit()
|
||||
|
||||
def print_exception(exc: BaseException) -> None: ...
|
||||
|
||||
path = ... # type: List[str]
|
||||
argv = ... # type: List[str]
|
||||
version = ... # type: str
|
||||
version_info = ... # type: Tuple[int, int, int]
|
||||
implementation = ... # type: Tuple[str, Tuple[int, int, int]]
|
||||
platform = ... # type: str
|
||||
byteorder = ... # type: str
|
||||
maxsize = ... # type: int
|
||||
modules = ... # type: Dict[str, Any]
|
@ -73,4 +73,5 @@ def exception(name: str, exc: BaseException) -> None:
|
||||
_log(name, DEBUG, "ui.Cancelled")
|
||||
else:
|
||||
_log(name, ERROR, "exception:")
|
||||
sys.print_exception(exc)
|
||||
# since mypy 0.770 we cannot override sys, so print_exception is unknown
|
||||
sys.print_exception(exc) # type: ignore
|
||||
|
Loading…
Reference in New Issue
Block a user