From: Chris Lamb Date: Tue, 27 Oct 2009 08:34:25 +0000 (+0000) Subject: Handle arguments with default kwargs in @session_wrapper. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a867e40c345441e6c12b283bd0aef0fd3f7ba12;p=dak Handle arguments with default kwargs in @session_wrapper. Signed-off-by: Chris Lamb --- 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()