# HG changeset patch # User Paul Boddie # Date 1307057435 -7200 # Node ID ffbf3cbb265819ac06014d6f73a7e079d240ad7f # Parent 9cc18edd5d884292fb32bd874aa99241e1f7487c Support modules in the object table. diff -r 9cc18edd5d88 -r ffbf3cbb2658 micropython/__init__.py --- a/micropython/__init__.py Thu Jun 02 23:08:17 2011 +0200 +++ b/micropython/__init__.py Fri Jun 03 01:30:35 2011 +0200 @@ -686,7 +686,9 @@ # properly collect usage from it. parent = attr.parent - if isinstance(parent, micropython.data.Instance): + if parent is None: + continue + elif isinstance(parent, micropython.data.Instance): parentname = objname else: parentname = parent.full_name() diff -r 9cc18edd5d88 -r ffbf3cbb2658 micropython/table.py --- a/micropython/table.py Thu Jun 02 23:08:17 2011 +0200 +++ b/micropython/table.py Fri Jun 03 01:30:35 2011 +0200 @@ -400,7 +400,10 @@ if not attributes.has_key(name): continue - if attributes[name].is_static_attribute(): + attr = attributes[name] + if isinstance(attr, (Class, Module)): + pass + elif attr.is_static_attribute(): is_static = 1 else: is_instance = 1