only set/use CARD and hwmon_dir if not None
This commit is contained in:
parent
4cb719255b
commit
61f10e6302
1 changed files with 29 additions and 28 deletions
|
@ -46,6 +46,7 @@ def find_card() -> Optional[Tuple[Optional[str], Optional[str]]]:
|
|||
|
||||
# base vars: card identifier, hwmon directory for stats, then the stat dicts
|
||||
CARD, hwmon_dir = find_card()
|
||||
if CARD is not None:
|
||||
card_dir = path.join("/sys/class/drm/", CARD) # eg: /sys/class/drm/card0/
|
||||
|
||||
# dictionary of known source files
|
||||
|
|
Reference in a new issue