forked from M-Labs/artiq
transforms/inline: support skipping of attr init
This commit is contained in:
parent
7d6b93d8eb
commit
c0c0137d9a
@ -433,6 +433,9 @@ def get_attr_init(attribute_namespace, loc_node):
|
||||
for (_, attr), attr_info in attribute_namespace.items():
|
||||
if hasattr(attr_info.obj, attr):
|
||||
value = getattr(attr_info.obj, attr)
|
||||
if (hasattr(value, "kernel_attr_init")
|
||||
and not value.kernel_attr_init):
|
||||
continue
|
||||
value = ast.copy_location(value_to_ast(value), loc_node)
|
||||
target = ast.copy_location(ast.Name(attr_info.mangled_name,
|
||||
ast.Store()),
|
||||
|
Loading…
Reference in New Issue
Block a user