Skip to content

Commit

Permalink
Fixes for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
achow101 committed Feb 14, 2019
1 parent a090b6a commit fd79eb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion hwilib/devices/ckcc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#
# - ec_mult, ec_setup, aes_setup, mitm_verify
#
import hid, sys, os
import hid, sys, os, platform
from binascii import b2a_hex, a2b_hex
from hashlib import sha256
from .protocol import CCProtocolPacker, CCProtocolUnpacker, CCProtoError, MAX_MSG_LEN, MAX_BLK_LEN
Expand All @@ -27,6 +27,8 @@ def __init__(self, sn=None, dev=None, encrypt=True):
self.is_simulator = False

if not dev and sn and '/' in sn:
if platform.system() == 'Windows':
raise RuntimeError("Cannot connect to simulator. Is it running?")
dev = UnixSimulatorPipe(sn)
found = 'simulator'
self.is_simulator = True
Expand Down
2 changes: 1 addition & 1 deletion hwilib/devices/trezorlib/transport/webusb.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def enumerate(cls) -> Iterable["WebUsbTransport"]:
# non-functional.
dev.getProduct()
devices.append(WebUsbTransport(dev))
except usb1.USBErrorNotSupported:
except:
pass
return devices

Expand Down

0 comments on commit fd79eb0

Please sign in to comment.