Skip to content

Commit

Permalink
Exit battery sensor retrival if path is non-existent
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-devs committed Sep 2, 2024
1 parent 8d94301 commit 873e7d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions psutil/_pslinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,9 @@ def sensors_battery():
meaning but under different names, see:
https://github.com/giampaolo/psutil/issues/966.
"""
if not os.path.isdir(POWER_SUPPLY_PATH):
return None

null = object()

def multi_bcat(*paths):
Expand Down

0 comments on commit 873e7d5

Please sign in to comment.