From 70d8a9c7a619da25e80e0cb5ff3189542d0e23ca Mon Sep 17 00:00:00 2001 From: Jason Kirtland Date: Tue, 4 Mar 2008 21:35:15 +0000 Subject: [PATCH] - Updated exception messaging for r4220 --- lib/sqlalchemy/sql/expression.py | 10 +++++----- test/engine/bind.py | 11 +++++------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index 9fb0e596ae..8e2a13e7ce 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -1001,11 +1001,11 @@ class ClauseElement(object): e = self.bind if e is None: label = getattr(self, 'description', self.__class__.__name__) - msg = ('This %s is not bound to an Engine or Connection. ' - 'Execution can not proceed without a database to execute ' - 'against. Either execute with an explicit connection or ' - 'bind the MetaData of the underlying tables to enable ' - 'implicit execution.') % label + msg = ('This %s is not bound and does not support direct ' + 'execution. Supply this statement to a Connection or ' + 'Engine for execution. Or, assign a bind to the statement ' + 'or the Metadata of its underlying tables to enable ' + 'implicit execution via this method.' % label) raise exceptions.UnboundExecutionError(msg) return e.execute_clauseelement(self, multiparams, params) diff --git a/test/engine/bind.py b/test/engine/bind.py index db4955375d..b59cd284a1 100644 --- a/test/engine/bind.py +++ b/test/engine/bind.py @@ -203,12 +203,11 @@ class BindTest(TestBase): assert False except exceptions.UnboundExecutionError, e: assert str(e).endswith( - 'is not bound to an Engine or ' - 'Connection. Execution can not proceed without a ' - 'database to execute against. Either execute with ' - 'an explicit connection or bind the MetaData of the ' - 'underlying tables to enable implicit execution.') - + 'is not bound and does not support direct ' + 'execution. Supply this statement to a Connection or ' + 'Engine for execution. Or, assign a bind to the ' + 'statement or the Metadata of its underlying tables to ' + 'enable implicit execution via this method.') finally: if isinstance(bind, engine.Connection): bind.close() -- 2.47.3