From e31211c578854d63128a30c036e40eee5c43edc7 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 29 Oct 2015 14:25:58 -0400 Subject: - 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 --- lib/sqlalchemy/sql/schema.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/sql') 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 -- cgit v1.2.1