File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -122,21 +122,21 @@ def _sysfs_block_devices(self, block_devices):
122
122
full_sysfs_path = os .readlink (sysfs_path )
123
123
path_parts = full_sysfs_path .split ('/' )
124
124
125
- end_index = - 1
125
+ end_index = None
126
126
for index , part in enumerate (path_parts ):
127
127
if self .udp .search (part ):
128
128
end_index = index
129
129
break
130
130
131
- if end_index == - 1 :
131
+ if end_index == None :
132
132
logger .debug ('Did not find suitable usb folder for usb info: %s' , full_sysfs_path )
133
133
continue
134
134
135
135
usb_info_rel_path = path_parts [:end_index + 1 ]
136
136
usb_info_path = os .path .join (SYSFS_BLOCK_DEVICE_PATH , os .sep .join (usb_info_rel_path ))
137
137
138
- vendor_id = 'unknown'
139
- product_id = 'unknown'
138
+ vendor_id = None
139
+ product_id = None
140
140
141
141
vendor_id_file_paths = os .path .join (usb_info_path , 'idVendor' )
142
142
product_id_file_paths = os .path .join (usb_info_path , 'idProduct' )
Original file line number Diff line number Diff line change @@ -187,11 +187,11 @@ def _vid_pid_path_to_usb_info(vid_pid_path):
187
187
"""! Provide the vendor ID and product ID of a device based on its entry in the registry
188
188
@return Returns {'vendor_id': '<vendor ID>', 'product': '<product ID>'}
189
189
@details If the vendor ID or product ID can't be determined, they will be returned
190
- as 'unknown' .
190
+ as None .
191
191
"""
192
192
result = {
193
- 'vendor_id' : 'unknown' ,
194
- 'product_id' : 'unknown'
193
+ 'vendor_id' : None ,
194
+ 'product_id' : None
195
195
}
196
196
197
197
for component in vid_pid_path .split ('&' ):
You can’t perform that action at this time.
0 commit comments