diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2018-12-29 19:43:18 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2018-12-29 19:43:18 +0000 |
commit | b20b71948e4c80a0d89f10bb2842f81c38efea34 (patch) | |
tree | fbd9a99f1b3141121c91926b0a2f659713d90a30 /giscanner | |
parent | 37a94c19cbb73a7fcb846b5aa9cfd1dae920c1ff (diff) | |
download | gobject-introspection-b20b71948e4c80a0d89f10bb2842f81c38efea34.tar.gz |
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
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/girparser.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/giscanner/girparser.py b/giscanner/girparser.py index 3bc4a6f4..5fa9f510 100644 --- a/giscanner/girparser.py +++ b/giscanner/girparser.py @@ -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'], - doc.attrib['line'], + 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: |