1.1 --- a/micropython/data.py Mon Jan 14 18:44:32 2013 +0100
1.2 +++ b/micropython/data.py Mon Jan 14 23:26:31 2013 +0100
1.3 @@ -1424,23 +1424,26 @@
1.4 # Attribute usage methods that apply to module globals in certain
1.5 # circumstances.
1.6
1.7 + def can_use_name_for_usage(self, name):
1.8 + return name not in self.modified_names and not self.circular_import
1.9 +
1.10 def _use_attribute(self, name, attrname, value=None):
1.11 - if name not in self.modified_names and not self.circular_import:
1.12 + if self.can_use_name_for_usage(name):
1.13 return NamespaceDict._use_attribute(self, name, attrname, value)
1.14 else:
1.15 self.importer.use_name(attrname, self.full_name(), value)
1.16 return []
1.17
1.18 def _define_attribute_user_for_name(self, node, name):
1.19 - if name not in self.modified_names and not self.circular_import:
1.20 + if self.can_use_name_for_usage(name):
1.21 NamespaceDict._define_attribute_user_for_name(self, node, name)
1.22
1.23 def _init_attribute_user_for_name(self, node, name):
1.24 - if name not in self.modified_names and not self.circular_import:
1.25 + if self.can_use_name_for_usage(name):
1.26 NamespaceDict._init_attribute_user_for_name(self, node, name)
1.27
1.28 def _define_attribute_accessor(self, name, attrname, node, value):
1.29 - if name not in self.modified_names and not self.circular_import:
1.30 + if self.can_use_name_for_usage(name):
1.31 NamespaceDict._define_attribute_accessor(self, name, attrname, node, value)
1.32 else:
1.33 self.importer.use_name(attrname, self.full_name(), value)