Commit b20b7194 authored by Emmanuele Bassi's avatar Emmanuele Bassi

Do not bail out when parsing GIR files without doc positions

The position attributes on a <doc> element are not mandatory, so we
should have some fallback value if they are missing.

Fixes: #252
parent 37a94c19
Pipeline #48286 passed with stages
in 6 minutes and 36 seconds
......@@ -185,8 +185,8 @@ class GIRParser(object):
if doc is not None:
if doc.text:
obj.doc = doc.text
obj.doc_position = Position(doc.attrib['filename'],
obj.doc_position = Position(doc.attrib.get('filename', '<unknown>'),
doc.attrib.get('line', None),
doc.attrib.get('column', None))
version = node.attrib.get('version')
if version:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment