diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-08-09 20:50:46 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-08-09 20:50:46 +0000 |
| commit | e7241263aa9db24885b41984b85300178428a60c (patch) | |
| tree | 7c2e9a8bbab97e390d02b13865db5a68d166995a /lib/sqlalchemy/schema.py | |
| parent | 7974625e8b86a28f3ac81c3c620df9b2801b133d (diff) | |
| download | sqlalchemy-e7241263aa9db24885b41984b85300178428a60c.tar.gz | |
python3k fixes
Diffstat (limited to 'lib/sqlalchemy/schema.py')
| -rw-r--r-- | lib/sqlalchemy/schema.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index ec7a9f394..7af4d39d4 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -170,7 +170,16 @@ class Table(SchemaItem, expression.TableClause): ddl_events = ('before-create', 'after-create', 'before-drop', 'after-drop') - def __new__(cls, name, metadata, *args, **kw): + def __new__(cls, *args, **kw): + if not args: + # python3k pickle seems to call this + return object.__new__(cls) + + try: + name, metadata, args = args[0], args[1], args[2:] + except IndexError: + raise TypeError("Table() takes at least two arguments") + schema = kw.get('schema', None) useexisting = kw.pop('useexisting', False) mustexist = kw.pop('mustexist', False) |
