device: import device-specific defs module lazily

It may fail on unsupported platforms (e.g. keepkeylib does not supoprt Python 3)
This commit is contained in:
Roman Zeyde
2016-12-27 12:34:07 +02:00
parent 604b2b7e99
commit cad2ec1239
2 changed files with 15 additions and 9 deletions

View File

@@ -20,7 +20,10 @@ def _verify_support(identity, ecdh):
class KeepKey(trezor.Trezor):
"""Connection to KeepKey device."""
from . import keepkey_defs as defs
@property
def _defs(self):
from . import keepkey_defs
return keepkey_defs
required_version = '>=1.0.4'