Skip to content

Commit

Permalink
using basename to extract name
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwbaule committed Oct 26, 2023
1 parent a0da66f commit 4c7a885
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion psutil/_pslinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ def sensors_fans():
except (IOError, OSError) as err:
debug(err)
continue
fallback_label = os.path.split(base)[1]
fallback_label = os.path.basename(base)
unit_name = cat(os.path.join(os.path.dirname(base), 'name')).strip()
label = cat(base + '_label', fallback=f'{fallback_label}').strip()
ret[unit_name].append(_common.sfan(label, current))
Expand Down

0 comments on commit 4c7a885

Please sign in to comment.