decompile: Fix bug in lookup tags

A lookup tag with no type attribute would crash the decompiler, even if
that was valid. This wasn't caught by the tests since blueprint never
generates such XML.

Also fixed a bug in the tests that caused decompiler-only tests not to
run.
This commit is contained in:
James Westman 2025-04-25 20:13:01 -05:00
parent a83c7e936d
commit a12d3f5c81
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
5 changed files with 39 additions and 13 deletions

View file

@ -255,7 +255,11 @@ def decompile_element(
ctx._node_stack.append(xml)
ctx.start_block()
gir = decompiler(*args, **kwargs)
try:
gir = decompiler(*args, **kwargs)
except TypeError as e:
raise UnsupportedError(tag=xml.tag)
if not decompiler._skip_children:
for child in xml.children:
@ -266,8 +270,6 @@ def decompile_element(
except UnsupportedError as e:
raise e
except TypeError as e:
raise UnsupportedError(tag=xml.tag)
def decompile(data: str) -> str: