summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xml/generate-introspection.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/xml/generate-introspection.py b/xml/generate-introspection.py
index 03309101..a0b4d1ec 100644
--- a/xml/generate-introspection.py
+++ b/xml/generate-introspection.py
@@ -68,7 +68,11 @@ def generate_introspection (inputs, c_output_filename, h_output_filename):
for input_filename in inputs:
#Open the XML file and process includes.
- tree = ElementTree.parse (input_filename)
+ try:
+ tree = ElementTree.parse (input_filename)
+ except Exception as e:
+ raise type(e)(f"Invalid XML while parsing {input_filename}: {str(e)}")
+
root = tree.getroot ()
for itf in root.findall ("interface"):