From 46bbb691ca64184ea6f5f8be6fbf66e783e068ed Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Fri, 31 Oct 2014 13:42:57 +0200 Subject: [PATCH] Make get_dfu_devices compatible with pyusb 1.0.0b2 --- usr/pydfu.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usr/pydfu.py b/usr/pydfu.py index 494e36b3d..d55c9e268 100755 --- a/usr/pydfu.py +++ b/usr/pydfu.py @@ -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):