Checking for the presence of the seperator in the return from .partition is a

more "correct" way of doing this
This commit is contained in:
jesopo 2018-10-04 15:27:52 +01:00
parent feed251f82
commit f2d9ff9d3b

View file

@ -136,8 +136,8 @@ def get_hashflags(filename):
if not line.startswith("#"): if not line.startswith("#"):
break break
elif line.startswith("#--"): elif line.startswith("#--"):
hashflag, _, value = line.replace("#--", "", 1).partition(" ") hashflag, sep, value = line.replace[3:].partition(" ")
hashflags[hashflag] = value or None hashflags[hashflag] = value if sep else None
return hashflags.items() return hashflags.items()
class Docstring(object): class Docstring(object):