diff --git a/trezorlib/transport/__init__.py b/trezorlib/transport/__init__.py index c586e3fcee..83f35b905b 100644 --- a/trezorlib/transport/__init__.py +++ b/trezorlib/transport/__init__.py @@ -17,6 +17,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library. If not, see . + class TransportException(Exception): pass @@ -86,7 +87,7 @@ def get_transport(path=None, prefix_search=False): # Find whether B is prefix of A (transport name is part of the path) # or A is prefix of B (path is a prefix, or a name, of transport). # This naively expects that no two transports have a common prefix. - def match_prefix(a,b): + def match_prefix(a, b): return a.startswith(b) or b.startswith(a) transports = [t for t in all_transports() if match_prefix(path, t.PATH_PREFIX)] diff --git a/trezorlib/transport/udp.py b/trezorlib/transport/udp.py index 059222377c..7bbad169c1 100644 --- a/trezorlib/transport/udp.py +++ b/trezorlib/transport/udp.py @@ -51,7 +51,7 @@ class UdpTransport(Transport): def find_debug(self): host, port = self.device - return UdpTransport('{}:{}'.format(host, port+1), self.protocol) + return UdpTransport('{}:{}'.format(host, port + 1), self.protocol) @classmethod def _try_path(cls, path):