From de728c9824e1b44bdb41dc03c259c8c4b90e59e5 Mon Sep 17 00:00:00 2001 From: George Rennie Date: Mon, 4 Nov 2024 14:08:57 +0100 Subject: [PATCH] pyosys generator: ignore attributes * this allows log_error, log_file_error and log_cmd_error which are all marked [[noreturn]] to be supported --- misc/py_wrap_generator.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc/py_wrap_generator.py b/misc/py_wrap_generator.py index 91a82081ae4..6c0e09326f5 100644 --- a/misc/py_wrap_generator.py +++ b/misc/py_wrap_generator.py @@ -1268,6 +1268,11 @@ def from_string(str_def, containing_file, class_, line_number, namespace): func.duplicate = False func.namespace = namespace str_def = str_def.replace("operator ","operator") + + # remove attributes from the start + if str.startswith(str_def, "[[") and "]]" in str_def: + str_def = str_def[str_def.find("]]")+2:] + if str.startswith(str_def, "static "): func.is_static = True str_def = str_def[7:]