From 69f7084c9b79b0b70f2b24400fb150a0a40d0424 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 1 Sep 2007 19:49:26 +0000 Subject: - merged inline inserts branch - all executemany() style calls put all sequences and SQL defaults inline into a single SQL statement and don't do any pre-execution - regular Insert and Update objects can have inline=True, forcing all executions to be inlined. - no last_inserted_ids(), lastrow_has_defaults() available with inline execution - calculation of pre/post execute pushed into compiler; DefaultExecutionContext greatly simplified - fixed postgres reflection of primary key columns with no sequence/default generator, sets autoincrement=False - fixed postgres executemany() behavior regarding sequences present, not present, passivedefaults, etc. - all tests pass for sqlite, mysql, postgres; oracle tests pass as well as they did previously including all insert/update/default functionality --- lib/sqlalchemy/exceptions.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/sqlalchemy/exceptions.py') diff --git a/lib/sqlalchemy/exceptions.py b/lib/sqlalchemy/exceptions.py index 709b0a3da..9c7caedd0 100644 --- a/lib/sqlalchemy/exceptions.py +++ b/lib/sqlalchemy/exceptions.py @@ -81,20 +81,20 @@ class DBAPIError(SQLAlchemyError): Its type and properties are DB-API implementation specific. """ - def __new__(cls, statement, params, orig, *args, **kw): + def instance(cls, statement, params, orig): # Don't ever wrap these, just return them directly as if # DBAPIError didn't exist. if isinstance(orig, (KeyboardInterrupt, SystemExit)): return orig if orig is not None: - name, glob = type(orig).__name__, globals() + name, glob = orig.__class__.__name__, globals() if name in glob and issubclass(glob[name], DBAPIError): cls = glob[name] - return SQLAlchemyError.__new__(cls, statement, params, orig, - *args, **kw) - + return cls(statement, params, orig) + instance = classmethod(instance) + def __init__(self, statement, params, orig): SQLAlchemyError.__init__(self, "(%s) %s" % (orig.__class__.__name__, str(orig))) -- cgit v1.2.1