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:
if line[0] == ":": if line[0] == ":":
line_split = line.split(": ", 1) key, _, value = line.partition(": ")
last_item = value
value = None items[value] = value
if len(line_split) > 1:
value = line_split[1]
last_item = line_split[0][1:].lower()
items[last_item] = value
else: else:
if last_item: if last_item:
items[last_item] += " %s" % line items[last_item] += " %s" % line