summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/context.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/orm/context.py')
-rw-r--r--lib/sqlalchemy/orm/context.py22
1 files changed, 8 insertions, 14 deletions
diff --git a/lib/sqlalchemy/orm/context.py b/lib/sqlalchemy/orm/context.py
index f438b0b3a..e59bc4871 100644
--- a/lib/sqlalchemy/orm/context.py
+++ b/lib/sqlalchemy/orm/context.py
@@ -1403,13 +1403,10 @@ class ORMSelectCompileState(ORMCompileState, SelectState):
try:
right = right.entity
except AttributeError as err:
- util.raise_(
- sa_exc.ArgumentError(
- "Join target %s does not refer to a "
- "mapped entity" % right
- ),
- replace_context=err,
- )
+ raise sa_exc.ArgumentError(
+ "Join target %s does not refer to a "
+ "mapped entity" % right
+ ) from err
left = onclause._parententity
@@ -1558,13 +1555,10 @@ class ORMSelectCompileState(ORMCompileState, SelectState):
try:
right = right.entity
except AttributeError as err:
- util.raise_(
- sa_exc.ArgumentError(
- "Join target %s does not refer to a "
- "mapped entity" % right
- ),
- replace_context=err,
- )
+ raise sa_exc.ArgumentError(
+ "Join target %s does not refer to a "
+ "mapped entity" % right
+ ) from err
left = onclause._parententity