Improve meminfo parse logic
This commit is contained in:
parent
820598b1b8
commit
6f6f3cedd9
1 changed files with 1 additions and 6 deletions
|
@ -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":
|
||||
|
|
Loading…
Reference in a new issue