Improve meminfo parse logic

This commit is contained in:
Thaynã Moretti 2020-08-30 12:28:48 -03:00
parent 820598b1b8
commit 6f6f3cedd9

View file

@ -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":