simplify code

plugins
papajoker 2019-11-24 16:26:25 +01:00
parent 10656015b7
commit 7687a57279
1 changed files with 4 additions and 6 deletions

View File

@ -333,12 +333,10 @@ def get_lsb_infos():
for line in lsb_release: for line in lsb_release:
if "=" in line: if "=" in line:
var, arg = line.rstrip().split("=") var, arg = line.rstrip().split("=")
if var.startswith("DISTRIB_"): if not arg:
var = var[8:] continue
if arg.startswith("\"") and arg.endswith("\""): var = var.replace("DISTRIB_","")
arg = arg[1:-1] lsb[var] = arg.strip('"')
if arg:
lsb[var] = arg
except (OSError, KeyError) as error: except (OSError, KeyError) as error:
print(error) print(error)
return 'not Manjaro', '0.0' return 'not Manjaro', '0.0'