diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-04 17:17:53 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-04 17:17:53 -0500 |
| commit | a261a78894c4f835b5da7fcbfb3d466a687bc11b (patch) | |
| tree | 98dea76e9c772816750a25499b1012ba36b0ac3a /lib/sqlalchemy/sql | |
| parent | 2ec4aa792c0ec87b2bb10ec172e8bdacfb7b824a (diff) | |
| download | sqlalchemy-a261a78894c4f835b5da7fcbfb3d466a687bc11b.tar.gz | |
fix type string formatting calls
Fixed type-related error messages that would fail for values that were
tuples, due to string formatting syntax, including compile of unsupported
literal values and invalid boolean values.
Fixes: #7721
Change-Id: I6775721486ef2db2d0738b9aa08b9f2570f55659
Diffstat (limited to 'lib/sqlalchemy/sql')
| -rw-r--r-- | lib/sqlalchemy/sql/sqltypes.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqlalchemy/sql/sqltypes.py b/lib/sqlalchemy/sql/sqltypes.py index 3794fd8f7..bf5f1dc1b 100644 --- a/lib/sqlalchemy/sql/sqltypes.py +++ b/lib/sqlalchemy/sql/sqltypes.py @@ -1755,10 +1755,10 @@ class Boolean(Emulated, TypeEngine[bool], SchemaType): def _strict_as_bool(self, value): if value not in self._strict_bools: if not isinstance(value, int): - raise TypeError("Not a boolean value: %r" % value) + raise TypeError("Not a boolean value: %r" % (value,)) else: raise ValueError( - "Value %r is not None, True, or False" % value + "Value %r is not None, True, or False" % (value,) ) return value @@ -3087,7 +3087,7 @@ class NullType(TypeEngine): def literal_processor(self, dialect): def process(value): raise exc.CompileError( - "Don't know how to render literal SQL value: %r" % value + "Don't know how to render literal SQL value: %r" % (value,) ) return process @@ -3181,7 +3181,7 @@ def _resolve_value_to_type(value): insp.__class__ in inspection._registrars ): raise exc.ArgumentError( - "Object %r is not legal as a SQL literal value" % value + "Object %r is not legal as a SQL literal value" % (value,) ) return NULLTYPE else: |
