diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-08-28 16:55:22 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-08-28 16:55:22 +0000 |
commit | 2e077dc627bfbc9f81cdb363a1ea1acf32f4cfe9 (patch) | |
tree | 915e3b47aef3dbdbd0f584ef89c4cf7a074da7e1 /lib/sqlalchemy | |
parent | 7252ccd7c988d2fe2f218401a0a81738e19fa239 (diff) | |
download | sqlalchemy-2e077dc627bfbc9f81cdb363a1ea1acf32f4cfe9.tar.gz |
- deregister Table from MetaData when autoload fails; [ticket:289]
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r-- | lib/sqlalchemy/schema.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index bb9e534c7..f4e89ef24 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -91,10 +91,14 @@ class TableSingleton(type): # we do it after the table is in the singleton dictionary to support # circular foreign keys if autoload: - if autoload_with: - autoload_with.reflecttable(table) - else: - metadata.engine.reflecttable(table) + try: + if autoload_with: + autoload_with.reflecttable(table) + else: + metadata.engine.reflecttable(table) + except exceptions.NoSuchTableError: + table.deregister() + raise # initialize all the column, etc. objects. done after # reflection to allow user-overrides table._init_items(*args) |