Fixed /etc/os-release parsing.

fix #399
This commit is contained in:
Antoine Nguyen
2021-11-04 10:26:02 +01:00
parent f7985a9d03
commit 04b38cf52a

View File

@@ -79,11 +79,10 @@ def dist_info():
if os.path.exists(path): if os.path.exists(path):
info = {} info = {}
with open(path) as fp: with open(path) as fp:
while True: for line in fp.readlines():
l = fp.readline() if line == '\n':
if not l: continue
break key, value = line.split("=")
key, value = l.split("=")
value = value.rstrip('"\n') value = value.rstrip('"\n')
value = value.strip('"') value = value.strip('"')
info[key] = value info[key] = value