Commits

Kirk Strauser committed 085bc15

In describe.describe(), skip non-Table items

If an item in the scanned module was not something that mapper() could handle
and was not a Table object, the `entity` variable would never be defined and
the `if entity not in entries:` line would fail with

UnboundLocalError: local variable 'entity' referenced before assignment

I ran across this when my model module contained

Base = declarative_base()

and describe() wasn't sure what to do with it.

  • Participants
  • Parent commits 8fa0970

Comments (0)

Files changed (1)

sadisplay/describe.py

         except (exc.ArgumentError, orm.exc.UnmappedClassError):
             if isinstance(item, Table):
                 entity = EntryItem(table=item)
+            else:
+                continue
         else:
             entity = EntryItem(mapper=mapper)