Fix comment handling if the value is empty (fixes #6514)

This commit is contained in:
Gunter Labes 2022-02-15 15:11:39 +01:00
parent c3aaabd26c
commit ef2205aa62
2 changed files with 3 additions and 6 deletions

View file

@ -157,13 +157,12 @@ def parse_attribute(line):
where = line.find("=")
leader = line[:where]
after = line[where+1:]
after = after.lstrip()
if re.search("\s#", after):
where = len(re.split("\s+#", after)[0])
value = after[:where]
value = after[:where].lstrip()
comment = after[where:]
else:
value = after.rstrip()
value = after.strip()
comment = ""
# Return four fields: stripped key, part of line before value,
# value, trailing whitespace and comment.

View file

@ -2233,9 +2233,7 @@ to be called on their own".format(filename, num))
print('"%s", line %d: macro reference in translatable string'\
% (filename, i+1))
# Check correctness of translation marks and descriptions
if key.startswith("#"): # FIXME: parse_attribute is confused.
pass
elif key.startswith("{"):
if key.startswith("{"):
pass
elif in_name_generator:
pass