Add additional try/except to test workaround for issue
@@ -481,6 +481,7 @@ class HIDManager(object):
self.devices = self._get_devices()
def _get_devices(self):
+ try:
# Tell manager that we are willing to match *any* device.
# (Alternatively, we could restrict by device usage, or usage page.)
iokit.IOHIDManagerSetDeviceMatching(self.managerRef, None)
@@ -488,6 +489,8 @@ class HIDManager(object):
cfset = c_void_p(iokit.IOHIDManagerCopyDevices(self.managerRef))
devices = cfset_to_set(cfset)
cf.CFRelease(cfset)
+ except:
+ return set()
return devices
def open(self):
