mirror of
https://github.com/vcrhonek/hwdata
synced 2025-10-14 02:43:35 +08:00
Fix unescaped backslashes in pci.ids check
Signed-off-by: Vitezslav Crhonek <vcrhonek@redhat.com>
This commit is contained in:
@@ -11,11 +11,11 @@ lineno = 1
|
||||
|
||||
file = open("pci.ids")
|
||||
hexnum = '([0-9a-fA-F]{4})'
|
||||
desc = '(.*\S)'
|
||||
desc = '(.*\\S)'
|
||||
|
||||
for line in file:
|
||||
|
||||
m = re.match(hexnum + '\s+' + desc, line)
|
||||
m = re.match(hexnum + '\\s+' + desc, line)
|
||||
if m:
|
||||
new_id = int('0x' + m.group (1), 16)
|
||||
if vendor_id is not None and new_id <= vendor_id:
|
||||
@@ -26,7 +26,7 @@ for line in file:
|
||||
vendor_id = new_id
|
||||
device_id = -1
|
||||
|
||||
m = re.match('\t' + hexnum + '\s+' + desc, line)
|
||||
m = re.match('\t' + hexnum + '\\s+' + desc, line)
|
||||
if m:
|
||||
new_id = int('0x' + m.group (1), 16)
|
||||
if new_id <= device_id:
|
||||
|
Reference in New Issue
Block a user