simplify code
parent
10656015b7
commit
7687a57279
|
@ -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'
|
||||||
|
|
Loading…
Reference in New Issue