From d57d0fc211ee70f8af9aa7951938cfff6c322382 Mon Sep 17 00:00:00 2001 From: Andrzej Raczkowski Date: Fri, 8 Jan 2021 10:49:20 +0100 Subject: [PATCH] Update bpytop.py I changed the ``os.getloadavg()`` to ``psutil.getloadavg()`` to fix the error: ``` /usr/lib/python3.9/site-packages/bpytop.py", line 2849, in _collect cls.load_avg = [round(lavg, 2) for lavg in os.getloadavg()] AttributeError: module 'os' has no attribute 'getloadavg' 08/01/21 (09:35:18) | WARNING: Exiting with errorcode (1). Runtime 0:00:05 ``` --- bpytop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bpytop.py b/bpytop.py index 2318804..43b21df 100755 --- a/bpytop.py +++ b/bpytop.py @@ -2846,7 +2846,7 @@ class CpuCollector(Collector): errlog.exception(f'{e}') else: pass - cls.load_avg = [round(lavg, 2) for lavg in os.getloadavg()] + cls.load_avg = [round(lavg, 2) for lavg in psutil.getloadavg()] cls.uptime = str(timedelta(seconds=round(time()-psutil.boot_time(),0)))[:-3] if CONFIG.check_temp and cls.got_sensors: