]> git.decadent.org.uk Git - dak.git/commitdiff
Correct logic with detecting default kwarg values vs positional args.
authorChris Lamb <lamby@debian.org>
Tue, 27 Oct 2009 08:47:48 +0000 (08:47 +0000)
committerChris Lamb <lamby@debian.org>
Tue, 27 Oct 2009 08:47:48 +0000 (08:47 +0000)
Signed-off-by: Chris Lamb <lamby@debian.org>
daklib/dbconn.py

index 905bc47d081e5445228f250a13e951353fa943dd..f5a19c1236442360ca57b7b867eed9f24f5f5003 100755 (executable)
@@ -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()