client: do not coerce self.features.vendor to string

There is no good reason to do that and it hides situations when
the field mistakenly doesn't exist.

Added comment explains that missing "vendor" field might by caused
by trezor-common mismatch, which fixes #328
pull/25/head
matejcik 6 years ago
parent ca345e9766
commit 560a5215c5

@ -180,8 +180,11 @@ class ProtocolMixin(object):
raise exceptions.TrezorException("Unexpected initial response")
else:
self.features = resp
if str(self.features.vendor) not in self.VENDORS:
if self.features.vendor not in self.VENDORS:
raise RuntimeError("Unsupported device")
# A side-effect of this is a sanity check for broken protobuf definitions.
# If the `vendor` field doesn't exist, you probably have a mismatched
# checkout of trezor-common.
@staticmethod
def expand_path(n):

Loading…
Cancel
Save