summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/exc.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/exc.py')
-rw-r--r--lib/sqlalchemy/exc.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/sqlalchemy/exc.py b/lib/sqlalchemy/exc.py
index 88edba328..fa46a46c4 100644
--- a/lib/sqlalchemy/exc.py
+++ b/lib/sqlalchemy/exc.py
@@ -49,7 +49,7 @@ class HasDescriptionCode:
code = kw.pop("code", None)
if code is not None:
self.code = code
- super(HasDescriptionCode, self).__init__(*arg, **kw)
+ super().__init__(*arg, **kw)
def _code_str(self) -> str:
if not self.code:
@@ -65,7 +65,7 @@ class HasDescriptionCode:
)
def __str__(self) -> str:
- message = super(HasDescriptionCode, self).__str__()
+ message = super().__str__()
if self.code:
message = "%s %s" % (message, self._code_str())
return message
@@ -134,9 +134,7 @@ class ObjectNotExecutableError(ArgumentError):
"""
def __init__(self, target: Any):
- super(ObjectNotExecutableError, self).__init__(
- "Not an executable object: %r" % target
- )
+ super().__init__("Not an executable object: %r" % target)
self.target = target
def __reduce__(self) -> Union[str, Tuple[Any, ...]]:
@@ -223,7 +221,7 @@ class UnsupportedCompilationError(CompileError):
element_type: Type[ClauseElement],
message: Optional[str] = None,
):
- super(UnsupportedCompilationError, self).__init__(
+ super().__init__(
"Compiler %r can't render element of type %s%s"
% (compiler, element_type, ": %s" % message if message else "")
)
@@ -557,7 +555,7 @@ class DBAPIError(StatementError):
dbapi_base_err: Type[Exception],
hide_parameters: bool = False,
connection_invalidated: bool = False,
- dialect: Optional["Dialect"] = None,
+ dialect: Optional[Dialect] = None,
ismulti: Optional[bool] = None,
) -> StatementError:
...
@@ -572,7 +570,7 @@ class DBAPIError(StatementError):
dbapi_base_err: Type[Exception],
hide_parameters: bool = False,
connection_invalidated: bool = False,
- dialect: Optional["Dialect"] = None,
+ dialect: Optional[Dialect] = None,
ismulti: Optional[bool] = None,
) -> DontWrapMixin:
...
@@ -587,7 +585,7 @@ class DBAPIError(StatementError):
dbapi_base_err: Type[Exception],
hide_parameters: bool = False,
connection_invalidated: bool = False,
- dialect: Optional["Dialect"] = None,
+ dialect: Optional[Dialect] = None,
ismulti: Optional[bool] = None,
) -> BaseException:
...
@@ -601,7 +599,7 @@ class DBAPIError(StatementError):
dbapi_base_err: Type[Exception],
hide_parameters: bool = False,
connection_invalidated: bool = False,
- dialect: Optional["Dialect"] = None,
+ dialect: Optional[Dialect] = None,
ismulti: Optional[bool] = None,
) -> Union[BaseException, DontWrapMixin]:
# Don't ever wrap these, just return them directly as if
@@ -792,7 +790,7 @@ class Base20DeprecationWarning(SADeprecationWarning):
def __str__(self) -> str:
return (
- super(Base20DeprecationWarning, self).__str__()
+ super().__str__()
+ " (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)"
)