]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
amended code to use util.raise_
authorRamonWill <ramonwilliams@hotmail.co.uk>
Sun, 19 Jul 2020 22:30:07 +0000 (23:30 +0100)
committerRamonWill <ramonwilliams@hotmail.co.uk>
Sun, 19 Jul 2020 22:30:07 +0000 (23:30 +0100)
lib/sqlalchemy/orm/context.py

index 564845e7dee68d397af8481a28e390b91c11f81c..836c55fdc1e8e6faba0859fed49d62ce628fcd15 100644 (file)
@@ -1297,10 +1297,13 @@ class ORMSelectCompileState(ORMCompileState, SelectState):
                         try:
                             right = right.entity
                         except AttributeError as err:
-                            raise sa_exc.ArgumentError(
-                                "Join target %s does not refer to a "
-                                "mapped entity" % right
-                            ) from err
+                            util.raise_(
+                                sa_exc.ArgumentError(
+                                    "Join target %s does not refer to a "
+                                    "mapped entity" % right
+                                ),
+                                replace_context=err,
+                            )
 
                 left = onclause._parententity