From: Yutian Li Date: Thu, 23 Sep 2021 17:33:56 +0000 (-0400) Subject: Fix serialization of UnsupportedCompilationError X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7078%2Fhead;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Fix serialization of UnsupportedCompilationError Fixes #7077 --- diff --git a/lib/sqlalchemy/exc.py b/lib/sqlalchemy/exc.py index a24cf7ba49..978b2ebd09 100644 --- a/lib/sqlalchemy/exc.py +++ b/lib/sqlalchemy/exc.py @@ -188,6 +188,12 @@ class UnsupportedCompilationError(CompileError): "Compiler %r can't render element of type %s%s" % (compiler, element_type, ": %s" % message if message else "") ) + self.compiler = compiler + self.element_type = element_type + self.message = message + + def __reduce__(self): + return self._class__, (self.compiler, self.element_type, self.message) class IdentifierError(SQLAlchemyError):