avoid empty lines when parsing os-release
This commit is contained in:
parent
9b7dce0861
commit
38e6838697
1 changed files with 2 additions and 0 deletions
2
tasks.py
2
tasks.py
|
@ -42,6 +42,8 @@ def get_os() -> OsInfo:
|
|||
with open("/etc/os-release", "r") as f:
|
||||
for line in f.readlines():
|
||||
line = line.strip()
|
||||
if not line:
|
||||
continue
|
||||
key, value = line.split("=")
|
||||
d[key] = value.strip('"')
|
||||
name_value = d["ID"]
|
||||
|
|
Loading…
Reference in a new issue