if 'psycopg2.errors.UndefinedTable' in str(err)ERRORS_UNDEFINED_TABLE = (psycopg2.errors.UndefinedTable, )
try:
res = conn.execute(stmt)
except sa.exc.ProgrammingError as err:
if isinstance(err.orig, ERRORS_UNDEFINED_TABLE):
print('Table does not exist')
raise
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/f936b2c1-bdcf-4372-8943-00a31615d70a%40googlegroups.com.