Browse Source

Fix unescaped backslashes in pci.ids check

Signed-off-by: Vitezslav Crhonek <vcrhonek@redhat.com>
Vitezslav Crhonek 1 month ago
parent
commit
4c109fcdc8
1 changed files with 3 additions and 3 deletions
  1. 3 3
      check-pci-ids.py

+ 3 - 3
check-pci-ids.py

@@ -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: