diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-10-29 14:25:58 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-10-29 14:28:00 -0400 |
commit | e31211c578854d63128a30c036e40eee5c43edc7 (patch) | |
tree | bca9bfbfd46e7dd0e2e305bf88833ec1807c93de /lib/sqlalchemy/sql/schema.py | |
parent | c7d04beeac6ad54d638afb01783dee2d769aef9d (diff) | |
download | sqlalchemy-e31211c578854d63128a30c036e40eee5c43edc7.tar.gz |
- convert wrap_callable() to a general purpose update_wrapper-like
function; the caller still passes in the "wrapper"
- move tests for wrap_callable() to be generic util tests
- changelog for pullreq github:204
Diffstat (limited to 'lib/sqlalchemy/sql/schema.py')
-rw-r--r-- | lib/sqlalchemy/sql/schema.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index 0c433d16e..a88203e84 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -1981,13 +1981,13 @@ class ColumnDefault(DefaultGenerator): try: argspec = util.get_callable_argspec(fn, no_self=True) except TypeError: - return util.wrap_callable(fn) + return util.wrap_callable(lambda ctx: fn(), fn) defaulted = argspec[3] is not None and len(argspec[3]) or 0 positionals = len(argspec[0]) - defaulted if positionals == 0: - return util.wrap_callable(fn) + return util.wrap_callable(lambda ctx: fn(), fn) elif positionals == 1: return fn |