From 8d7c869c47069cdc5f6ba5e2cdcc77547e9673b8 Mon Sep 17 00:00:00 2001 From: varun-r-mallya Date: Thu, 4 Sep 2025 10:45:28 +0530 Subject: [PATCH] skip decorator constants --- pythonbpf/constants_pass.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pythonbpf/constants_pass.py b/pythonbpf/constants_pass.py index 8bd39fd..cd5ce1f 100644 --- a/pythonbpf/constants_pass.py +++ b/pythonbpf/constants_pass.py @@ -26,7 +26,9 @@ def constants_processing(tree, module): nonlocal current_function old_function = current_function current_function = node.name - self.generic_visit(node) + for child in ast.iter_child_nodes(node): + if not (hasattr(node, 'decorator_list') and child in node.decorator_list): + self.visit(child) current_function = old_function def visit_Constant(self, node):