diff options
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
-rw-r--r-- | lib/sqlalchemy/engine/base.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 4e11117f7..1e5285b35 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -675,14 +675,17 @@ class Compiled(object): """ self.dialect = dialect - self.statement = statement self.bind = bind - self.can_execute = statement.supports_execution + if statement is not None: + self.statement = statement + self.can_execute = statement.supports_execution + self.string = self.process(self.statement) + @util.deprecated("0.7", ":class:`.Compiled` objects now compile " + "within the constructor.") def compile(self): """Produce the internal string representation of this element.""" - - self.string = self.process(self.statement) + pass @property def sql_compiler(self): |