diff options
Diffstat (limited to 'lib/sqlalchemy/schema.py')
-rw-r--r-- | lib/sqlalchemy/schema.py | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index 030c400a7..b53eb8887 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -1154,24 +1154,15 @@ class Column(SchemaItem, expression.ColumnClause): nullable=self.nullable, quote=self.quote, _proxies=[self], *fk) - except TypeError as e: -# start Py3K - raise TypeError( - "Could not create a copy of this %r object. " - "Ensure the class includes a _constructor() " - "attribute or method which accepts the " - "standard Column constructor arguments, or " - "references the Column class itself." % self.__class__) from e -# end Py3K -# start Py2K -# raise TypeError( -# "Could not create a copy of this %r object. " -# "Ensure the class includes a _constructor() " -# "attribute or method which accepts the " -# "standard Column constructor arguments, or " -# "references the Column class itself. " -# "Original error: %s" % (self.__class__, e)) -# end Py2K + except TypeError: + util.raise_from_cause( + TypeError( + "Could not create a copy of this %r object. " + "Ensure the class includes a _constructor() " + "attribute or method which accepts the " + "standard Column constructor arguments, or " + "references the Column class itself." % self.__class__) + ) c.table = selectable selectable._columns.add(c) |