From 4a867e40c345441e6c12b283bd0aef0fd3f7ba12 Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Tue, 27 Oct 2009 08:34:25 +0000 Subject: [PATCH] Handle arguments with default kwargs in @session_wrapper. 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 ee057d5c..cb578bd7 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -65,7 +65,7 @@ def session_wrapper(fn): session = kwargs.get('session') # No session specified as last argument or in kwargs, create one. - if session is None and len(args) == len(getargspec(fn)[0]) - 1: + if session is None or len(args) == len(getargspec(fn)[0]) - 1: private_transaction = True kwargs['session'] = DBConn().session() -- 2.39.5