1.1 --- a/micropython/__init__.py Sat Jan 12 18:38:34 2013 +0100
1.2 +++ b/micropython/__init__.py Sun Jan 13 01:19:41 2013 +0100
1.3 @@ -311,12 +311,12 @@
1.4
1.5 elif isinstance(obj, Class):
1.6
1.7 + full_name = obj.full_name()
1.8 +
1.9 # Prevent ambiguous classes.
1.10
1.11 - full_name = obj.full_name()
1.12 -
1.13 - #if obj.module.has_key(name) and obj.module[name].defines_ambiguous_class():
1.14 - # raise TableGenerationError, "Class %r in module %r is ambiguously defined." % (name, obj.module.full_name())
1.15 + #if obj.module.has_key(obj.name) and obj.module[obj.name].defines_ambiguous_class():
1.16 + # raise TableGenerationError, "Class %r in module %r is ambiguously defined." % (obj.name, obj.module.full_name())
1.17
1.18 # Define a table entry for the class.
1.19
1.20 @@ -329,6 +329,13 @@
1.21 if descendant in all_objects:
1.22 attributes["#" + name] = descendant
1.23
1.24 + # Merge ambiguous classes.
1.25 +
1.26 + if t.has(full_name):
1.27 + old_attributes = t.get(full_name)
1.28 + old_attributes.update(attributes)
1.29 + attributes = old_attributes
1.30 +
1.31 t.add(full_name, attributes)
1.32
1.33 return self.objtable