From 38e68386970ad2e7579f38ecc257220457e6521c Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Fri, 10 Jul 2020 10:39:14 -0700 Subject: [PATCH] avoid empty lines when parsing os-release --- tasks.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks.py b/tasks.py index 8d04dd72..05f23d5f 100644 --- a/tasks.py +++ b/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"]