Make use of str.partition in Utils.parse_docstring

This commit is contained in:
jesopo 2018-10-02 17:47:28 +01:00
parent 362bbf89f7
commit 59a5d1283a

View file

@ -337,14 +337,9 @@ def parse_docstring(s):
if line:
if line[0] == ":":
line_split = line.split(": ", 1)
value = None
if len(line_split) > 1:
value = line_split[1]
last_item = line_split[0][1:].lower()
items[last_item] = value
key, _, value = line.partition(": ")
last_item = value
items[value] = value
else:
if last_item:
items[last_item] += " %s" % line