[at-spi2-core: 28/30] generate-introspection.py: Add the problematic filename to XML parse exceptions
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-core: 28/30] generate-introspection.py: Add the problematic filename to XML parse exceptions
- Date: Mon, 4 Jul 2022 19:25:18 +0000 (UTC)
commit f70c5698514868f5b65ff212e17cdc92f6a012a0
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Jul 4 14:06:39 2022 -0500
generate-introspection.py: Add the problematic filename to XML parse exceptions
Registry.xml had malformed XML; this is fixed in the commit that
removes "name" attributres from the the toplevel node elements.
However, to catch invalid XML in the future, we do it in the Python script.
xml/generate-introspection.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
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"):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]