From 6f6f3cedd930103f9f4bfd8b740dce43ce80422d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thayn=C3=A3=20Moretti?= Date: Sun, 30 Aug 2020 12:28:48 -0300 Subject: [PATCH] Improve meminfo parse logic --- bumblebee_status/modules/core/memory.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bumblebee_status/modules/core/memory.py b/bumblebee_status/modules/core/memory.py index 9b4a3ab..a4015ff 100644 --- a/bumblebee_status/modules/core/memory.py +++ b/bumblebee_status/modules/core/memory.py @@ -72,12 +72,7 @@ class Module(core.module.Module): data = {} with open("/proc/meminfo", "r") as f: # https://bugs.python.org/issue32933 - while True: - line = f.readline() - - if line == '': - break - + for line in f.readlines(): tmp = re.split(r"[:\s]+", line) value = int(tmp[1]) if tmp[2] == "kB":