mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-03-06 00:43:42 -05:00
Make partition detection code on windows a little more robust
This commit is contained in:
parent
6a4aec5fa5
commit
dd3de8a127
@ -100,8 +100,6 @@ class PRS505(Device):
|
||||
|
||||
@classmethod
|
||||
def is_device(cls, device_id):
|
||||
if not hasattr(device_id, 'upper'):
|
||||
return False
|
||||
device_id = device_id.upper()
|
||||
if 'VEN_'+cls.VENDOR_NAME in device_id and \
|
||||
'PROD_'+cls.PRODUCT_NAME in device_id:
|
||||
@ -144,7 +142,7 @@ class PRS505(Device):
|
||||
import wmi
|
||||
c = wmi.WMI()
|
||||
for drive in c.Win32_DiskDrive():
|
||||
if self.__class__.is_device(drive.PNPDeviceID):
|
||||
if self.__class__.is_device(str(drive.PNPDeviceID)):
|
||||
if drive.Partitions == 0:
|
||||
continue
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user