Skip to content

Commit 583c877

Browse files
committed
Correct type for Windows Registry check
1 parent cb03042 commit 583c877

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mbed_lstools/windows.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ def get_mbed_devices(self):
176176
mounts_key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, 'SYSTEM\MountedDevices')
177177
for point, label, _ in self.iter_vals(mounts_key):
178178
printable_label = label.decode('utf-16le', 'ignore')
179-
if (b'DosDevices' in point and
179+
if ('DosDevices' in point and
180180
any(v in printable_label.upper() for v in upper_ven)):
181181
logger.debug("Found Mount point %s with usb ID %s",point,
182182
printable_label)
183-
yield (point.decode('utf-8', 'ignore'), printable_label)
183+
yield (point, printable_label)
184184
else:
185185
logger.debug("Skipping Mount point %r label %r", point, label)

test/os_win7.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ def query_info_key(key):
105105
def test_one_nucleo_dev(self):
106106
value_dict = {
107107
(None, 'SYSTEM\MountedDevices'): [
108-
(b'\\DosDevices\\F:',
108+
('\\DosDevices\\F:',
109109
u'_??_USBSTOR#Disk&Ven_MBED&Prod_VFS&Rev_0.1#0240000032044e4500367009997b00086781000097969900&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}'.encode('utf-16le')),
110-
(b'\\DosDevices\\D:',
110+
('\\DosDevices\\D:',
111111
u'_??_USBSTOR#Disk&Ven_SEGGER&Prod_MSD_Volume&Rev_1.00#8&1b8e102b&0&000440035522&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}'.encode('utf-16le'))],
112112
((((((None, 'SYSTEM\CurrentControlSet\Enum'), 'USB'),
113113
'VID_0416&PID_511E'), '000440035522'), 'Device Parameters'), 'PortName'): ('COM7', None)

0 commit comments

Comments
 (0)