Skip to content

Commit

Permalink
q-dev: make pylint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrbartman committed Jun 12, 2024
1 parent 9e52556 commit 5d0ea72
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion qubes/device_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,15 @@ def _load_classes(bus: str):
result = {}
with open(f'/usr/share/hwdata/{bus}.ids',
encoding='utf-8', errors='ignore') as pciids:
# for `class_name` and `subclass_name`
# pylint: disable=used-before-assignment
# pylint: disable=possibly-used-before-assignment
class_id = None
subclass_id = None
for line in pciids.readlines():
line = line.rstrip()
if line.startswith('\t\t') and class_id and subclass_id:
if line.startswith('\t\t') \
and class_id is not None and subclass_id is not None:
(progif_id, _, progif_name) = line[2:].split(' ', 2)
result[class_id + subclass_id + progif_id] = \
f"{class_name}: {subclass_name} ({progif_name})"
Expand Down

0 comments on commit 5d0ea72

Please sign in to comment.