summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sqlalchemy/sql/schema.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py
index 69fc9408f..f0a697728 100644
--- a/lib/sqlalchemy/sql/schema.py
+++ b/lib/sqlalchemy/sql/schema.py
@@ -107,9 +107,11 @@ class SchemaItem(SchemaEventTarget, visitors.Visitable):
try:
spwd = item._set_parent_with_dispatch
except AttributeError:
- raise exc.ArgumentError(
- "'SchemaItem' object, such as a 'Column' or a "
- "'Constraint' expected, got %r" % item
+ util.raise_from_cause(
+ exc.ArgumentError(
+ "'SchemaItem' object, such as a 'Column' or a "
+ "'Constraint' expected, got %r" % item
+ )
)
else:
spwd(self)