From: Chris Lamb Date: Tue, 27 Oct 2009 08:47:48 +0000 (+0000) Subject: Correct logic with detecting default kwarg values vs positional args. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e1255ebafb6af101a5c3bf2c86d11e4873b535d;p=dak Correct logic with detecting default kwarg values vs positional args. Signed-off-by: Chris Lamb --- diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 905bc47d..f5a19c12 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -64,7 +64,7 @@ def session_wrapper(fn): session = kwargs.get('session') # No session specified as last argument or in kwargs, create one. - if session is None or len(args) == len(getargspec(fn)[0]) - 1: + if session is None and len(args) <= len(getargspec(fn)[0]) - 1: private_transaction = True kwargs['session'] = DBConn().session()