1.1 --- a/micropython/__init__.py Fri Jun 12 22:03:56 2009 +0200
1.2 +++ b/micropython/__init__.py Sun Jun 14 01:18:05 2009 +0200
1.3 @@ -343,10 +343,21 @@
1.4
1.5 for obj in module.all_objects:
1.6 if isinstance(obj, micropython.inspect.Class):
1.7 - attributes = {obj.full_name() : obj}
1.8 +
1.9 + # Prevent ambiguous classes.
1.10 +
1.11 + full_name = obj.full_name()
1.12 + name = obj.name
1.13 +
1.14 + if module.has_key(name) and module[name].defines_ambiguous_class():
1.15 + raise TableGenerationError, "Class %r in module %r is ambiguously defined." % (name, module.full_name())
1.16 +
1.17 + # Define a table entry for the class.
1.18 +
1.19 + attributes = {full_name : obj}
1.20 attributes.update(obj.all_attributes())
1.21 attributes.update(obj.all_descendants())
1.22 - t.add(obj.full_name(), attributes)
1.23 + t.add(full_name, attributes)
1.24
1.25 return self.objtable
1.26