This commit is contained in:
Benoit Masson 2017-01-09 00:42:46 +00:00 committed by GitHub
commit 118d3b0c10

View File

@ -104,6 +104,16 @@ class SQLitePlugin(object):
# Ignore it if it does not need a database handle. # Ignore it if it does not need a database handle.
argspec = inspect.getargspec(_callback) argspec = inspect.getargspec(_callback)
if keyword not in argspec.args: if keyword not in argspec.args:
#check for closure
no_keyword_arg = True
for closure in _callback.func_closure:
contents = closure.cell_contents
if callable(contents):
argspec = inspect.getargspec(contents)
if keyword in argspec.args:
no_keyword_arg = False
break
if no_keyword_arg:
return callback return callback
def wrapper(*args, **kwargs): def wrapper(*args, **kwargs):