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("#"):
break
elif line.startswith("#--"):
hashflag, _, value = line.replace("#--", "", 1).partition(" ")
hashflags[hashflag] = value or None
hashflag, sep, value = line.replace[3:].partition(" ")
hashflags[hashflag] = value if sep else None
return hashflags.items()
class Docstring(object):