From 01d92d3c8edc5b6fa24417ff5e4669b33ec75922 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Tue, 11 Nov 2025 08:13:45 -0500 Subject: [PATCH] [FIX] script search class model: upgrade to python 3.11 with ast --- script/code_generator/search_class_model.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/code_generator/search_class_model.py b/script/code_generator/search_class_model.py index fb6d9d3..f04557a 100755 --- a/script/code_generator/search_class_model.py +++ b/script/code_generator/search_class_model.py @@ -133,7 +133,7 @@ def extract_lambda(node): def fill_search_field(ast_obj, var_name="", py_filename=""): ast_obj_type = type(ast_obj) result = None - if ast_obj_type is ast.Str: + if ast_obj_type is ast.Constant: result = ast_obj.s elif ast_obj_type is ast.Lambda: result = extract_lambda(ast_obj) @@ -224,7 +224,7 @@ def main(): and type(node.targets[0]) is ast.Name # and node.targets[0].id in ("_name",) # and node.targets[0].id in ("_name", "_inherit") - and type(node.value) is ast.Str + and type(node.value) is ast.Constant ): model_name = "" is_inherit = False @@ -266,7 +266,7 @@ def main(): # Detect fields # TODO do it! if model_name and ( - type(node.value) is ast.Str + type(node.value) is ast.Constant and node.value.s == model_name or type(node.value) is ast.List and model_name