From a3df9a4bf2812dec8a3b7d812350ac6df7a1880f Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 6 Mar 2026 14:33:51 +0100 Subject: [PATCH] fix: make JSON reading backward compatible with old format --- f90wrap/parser.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/f90wrap/parser.py b/f90wrap/parser.py index 97c0c51c..44f64b0a 100644 --- a/f90wrap/parser.py +++ b/f90wrap/parser.py @@ -1790,7 +1790,13 @@ def add_external_packages(root, class_names, external_packages): module.is_external = True for typ in mod["types"]: new_type = Type(name=typ["name"], mod_name=module.name) - new_type.attributes = typ["attributes"] + try: + new_type.attributes = typ["attributes"] + except KeyError: + # This is for retrocompatibility with old json files + new_type.attributes = [] + if typ["has_assignment"]: + new_type.attributes.append("has_assignment") new_type.py_mod_name = mod["package"] new_type.is_external = True module.types.append(new_type)