Device detection: Fix a bug that could cause device detection to fail completely if devices with certain vendor/product ids are connected. Fixes #1009718 (Exception loading device plugins)

This commit is contained in:
Kovid Goyal 2012-06-07 12:07:22 +05:30
parent c86a32d92d
commit 3710b46c3c

View File

@ -178,7 +178,13 @@ class DevicePlugin(Plugin):
if cvid == vid:
if pid in products:
if hasattr(self.VENDOR_ID, 'keys'):
try:
cbcd = self.VENDOR_ID[vid][pid]
except KeyError:
# Vendor vid does not have product pid, pid
# exists for some other vendor in this
# device
continue
else:
cbcd = self.BCD
if self.test_bcd(bcd, cbcd):