1.1 --- a/micropython/ast.py Mon May 05 00:46:38 2008 +0200
1.2 +++ b/micropython/ast.py Sat May 10 02:32:20 2008 +0200
1.3 @@ -264,12 +264,15 @@
1.4
1.5 # Get the details of the access.
1.6
1.7 - target = last.attr.value
1.8 + if isinstance(last.attr, micropython.inspect.Const):
1.9 + target_name = last.attr.value_type_name()
1.10 + else:
1.11 + target = last.attr.value
1.12
1.13 - if isinstance(target, micropython.inspect.Const):
1.14 - target_name = target.value_type_name()
1.15 - else:
1.16 - target_name = target.full_name()
1.17 + if isinstance(target, micropython.inspect.Const):
1.18 + target_name = target.value_type_name()
1.19 + else:
1.20 + target_name = target.full_name()
1.21
1.22 # Access the object table to get the attribute position.
1.23
1.24 @@ -1064,7 +1067,11 @@
1.25 self._visitBinary(node, "__mul__", "__rmul__")
1.26
1.27 def visitName(self, node):
1.28 - self._visitName(node, (LoadName, LoadAddress))
1.29 + if node.name == "None":
1.30 + const = self.module.constant_values[None]
1.31 + self.new_op(LoadConst(const))
1.32 + else:
1.33 + self._visitName(node, (LoadName, LoadAddress))
1.34
1.35 def visitNot(self, node): pass
1.36