From 1e1255ebafb6af101a5c3bf2c86d11e4873b535d Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Tue, 27 Oct 2009 08:47:48 +0000 Subject: [PATCH] Correct logic with detecting default kwarg values vs positional args. Signed-off-by: Chris Lamb --- daklib/dbconn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() -- 2.39.5