Make get_dfu_devices compatible with pyusb 1.0.0b2

This commit is contained in:
iabdalkader 2014-10-31 13:42:57 +02:00
parent 47806afe4a
commit 46bbb691ca

View File

@ -360,9 +360,13 @@ def get_dfu_devices(*args, **kwargs):
Additional filters (like idProduct and idVendor) can be passed in to
refine the search.
"""
return usb.core.find(*args, find_all=True,
l = []
devices = usb.core.find(*args, find_all=True,
custom_match=FilterDFU(), **kwargs)
# convert to list for compatibility with newer pyusb
for d in devices:
l.append(d)
return l
def get_memory_layout(device):