File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -89,10 +89,16 @@ def get_libusb1_backend() -> "IBackend":
89
89
return usb .backend .libusb1 .get_backend (find_library = find_library )
90
90
91
91
92
- # TODO correct the type signature of find()
92
+ # TODO refine the type signature of find()
93
93
def find (* args : Any , ** kwargs : Any ) -> Any :
94
- """@brief Wrap pyusb's usb.core,find() function."""
94
+ """@brief Wrap pyusb's usb.core,find() function.
95
+
96
+ A 'backend' keyword argument will override the default of using `get_libusb1_backend()`.
97
+ If None is passed for 'backend', then the default backend lookup method of pyusb will
98
+ be used.
99
+ """
95
100
import usb .core
96
- return usb .core .find (* args , backend = get_libusb1_backend (), ** kwargs )
101
+ backend = kwargs .pop ('backend' , get_libusb1_backend ())
102
+ return usb .core .find (* args , backend = backend , ** kwargs )
97
103
98
104
You can’t perform that action at this time.
0 commit comments