diff --git a/requirements-dev.txt b/requirements-dev.txt index 2ac5dd064..f89b93afa 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,4 +5,4 @@ flake8 protobuf isort black; python_version >= "3.6" -autoflake +autoflake>=1.2 diff --git a/trezorlib/_ed25519.py b/trezorlib/_ed25519.py index 53379bfee..f1959ac96 100644 --- a/trezorlib/_ed25519.py +++ b/trezorlib/_ed25519.py @@ -32,7 +32,7 @@ arithmetic, so we cannot handle secrets without risking their disclosure. """ import hashlib -from typing import NewType, Tuple +from typing import List, NewType, Tuple Point = NewType("Point", Tuple[int, int, int, int]) diff --git a/trezorlib/log.py b/trezorlib/log.py index f8ac86e95..50f778a12 100644 --- a/trezorlib/log.py +++ b/trezorlib/log.py @@ -15,7 +15,7 @@ # If not, see . import logging -from typing import Optional +from typing import Optional, Set, Type from . import protobuf diff --git a/trezorlib/transport/__init__.py b/trezorlib/transport/__init__.py index c81d998b4..e0f54e999 100644 --- a/trezorlib/transport/__init__.py +++ b/trezorlib/transport/__init__.py @@ -15,15 +15,11 @@ # If not, see . import logging -from typing import Iterable, List, Set, Type +from typing import Iterable, List, Type from ..exceptions import TrezorException from ..protobuf import MessageType -if False: - # mark Set and List as used, otherwise they only exist in comments - List, Set - LOG = logging.getLogger(__name__) # USB vendor/product IDs for Trezors diff --git a/trezorlib/transport/bridge.py b/trezorlib/transport/bridge.py index 51446d02e..b44949b7c 100644 --- a/trezorlib/transport/bridge.py +++ b/trezorlib/transport/bridge.py @@ -24,10 +24,6 @@ import requests from . import Transport, TransportException from .. import mapping, protobuf -if False: - # mark Optional as used, otherwise it only exists in comments - Optional - LOG = logging.getLogger(__name__) TREZORD_HOST = "http://127.0.0.1:21325" diff --git a/trezorlib/transport/udp.py b/trezorlib/transport/udp.py index bb0ccfe78..53a8b0ac9 100644 --- a/trezorlib/transport/udp.py +++ b/trezorlib/transport/udp.py @@ -20,10 +20,6 @@ from typing import Iterable, Optional, cast from . import TransportException from .protocol import ProtocolBasedTransport, get_protocol -if False: - # mark Optional as used, otherwise it only exists in comments - Optional - class UdpTransport(ProtocolBasedTransport): diff --git a/trezorlib/transport/webusb.py b/trezorlib/transport/webusb.py index c1d576412..a4c2840ee 100644 --- a/trezorlib/transport/webusb.py +++ b/trezorlib/transport/webusb.py @@ -31,10 +31,6 @@ except Exception as e: LOG.warning("WebUSB transport is disabled: {}".format(e)) usb1 = None -if False: - # mark Optional as used, otherwise it only exists in comments - Optional - INTERFACE = 0 ENDPOINT = 1 DEBUG_INTERFACE = 1