Simplify hashflag parsing

This commit is contained in:
jesopo 2018-10-04 15:22:09 +01:00
parent c0fbe963a5
commit 8d3255c46d

View file

@ -136,12 +136,7 @@ def get_hashflags(filename):
if not line.startswith("#"): if not line.startswith("#"):
break break
elif line.startswith("#--"): elif line.startswith("#--"):
line_split = line.split(" ", 1) hashflag, _, value = line.replace("#--", "", 1).partition(" ")
hashflag = line_split[0][3:]
value = None
if len(line_split) > 1:
value = line_split[1]
hashflags[hashflag] = value hashflags[hashflag] = value
return hashflags.items() return hashflags.items()