1.1 --- a/micropython/common.py Mon Oct 29 22:27:15 2012 +0100
1.2 +++ b/micropython/common.py Fri Nov 02 00:34:27 2012 +0100
1.3 @@ -106,8 +106,14 @@
1.4 if exprs:
1.5 target_names = set()
1.6
1.7 + # For each expression value try and get a concrete
1.8 + # attribute.
1.9 +
1.10 for expr in exprs:
1.11 - attr = expr.get_static_attribute(node.attrname)
1.12 + attr = expr.all_attributes().get(node.attrname)
1.13 +
1.14 + # Where an attribute can be obtained, record its
1.15 + # details.
1.16
1.17 if attr:
1.18 target_names.add((attr.parent.full_name(), attr.is_static_attribute()))
1.19 @@ -135,11 +141,13 @@
1.20 for target_name, is_static in user._attrspecifictypes.get(node._username, []):
1.21 target_names.add((target_name, is_static))
1.22
1.23 - all_target_names.append(target_names)
1.24 + if target_names:
1.25 + all_target_names.append(target_names)
1.26
1.27 # Return the smallest set of target names.
1.28
1.29 all_target_names.sort(key=lambda x: len(x))
1.30 +
1.31 return all_target_names and all_target_names[0]
1.32
1.33 def used_by_unit(node):