diff options
Diffstat (limited to 'lib/sqlalchemy/sql/base.py')
-rw-r--r-- | lib/sqlalchemy/sql/base.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/base.py b/lib/sqlalchemy/sql/base.py index 4175fe89a..999169f90 100644 --- a/lib/sqlalchemy/sql/base.py +++ b/lib/sqlalchemy/sql/base.py @@ -875,7 +875,9 @@ class Executable(Generative): """Compile and execute this :class:`.Executable`.""" e = self.bind if e is None: - label = getattr(self, "description", self.__class__.__name__) + label = ( + getattr(self, "description", None) or self.__class__.__name__ + ) msg = ( "This %s is not directly bound to a Connection or Engine. " "Use the .execute() method of a Connection or Engine " |