mirror of https://github.com/aristocratos/bpytop
Fixed: Disable battery detection if /sys/class/power_supply is missing to avoid exception is psutil
parent
4fe5979b21
commit
e6966db15b
|
@ -533,6 +533,9 @@ except Exception as e:
|
|||
errlog.exception(f'{e}')
|
||||
raise SystemExit(1)
|
||||
|
||||
if not os.path.isdir("/sys/class/power_supply"):
|
||||
CONFIG.show_battery = False
|
||||
|
||||
if psutil.version_info[0] < 5 or (psutil.version_info[0] == 5 and psutil.version_info[1] < 7):
|
||||
warn = f'psutil version {".".join(str(x) for x in psutil.version_info)} detected, version 5.7.0 or later required for full functionality!'
|
||||
print("WARNING!", warn)
|
||||
|
|
Loading…
Reference in New Issue