From 82da734e8978896415d91bb02b9cd9c85c745f38 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 24 Sep 2014 17:02:33 +0800 Subject: [PATCH] transforms/inline: remove _is_in_attr_list --- artiq/transforms/inline.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/artiq/transforms/inline.py b/artiq/transforms/inline.py index 6d09736b3..5e7591a0e 100644 --- a/artiq/transforms/inline.py +++ b/artiq/transforms/inline.py @@ -13,12 +13,6 @@ from artiq.language import units _UserVariable = namedtuple("_UserVariable", "name") -def _is_in_attr_list(obj, attr, al): - if not hasattr(obj, al): - return False - return attr in getattr(obj, al).split() - - class _ReferenceManager: def __init__(self): # (id(obj), func_name, local_name) or (id(obj), kernel_attr_name) @@ -66,7 +60,7 @@ class _ReferenceManager: return getattr(builtins, ref.id) elif isinstance(ref, ast.Attribute): target = self.get(obj, func_name, ref.value) - if _is_in_attr_list(target, ref.attr, "kernel_attr"): + if hasattr(target, "kernel_attr") and ref.attr in target.kernel_attr.split(): key = (id(target), ref.attr) try: ival = self.to_inlined[key]