]> git.decadent.org.uk Git - dak.git/commitdiff
If None is passed in.
authorChris Lamb <lamby@debian.org>
Tue, 27 Oct 2009 15:18:11 +0000 (15:18 +0000)
committerChris Lamb <lamby@debian.org>
Tue, 27 Oct 2009 15:18:11 +0000 (15:18 +0000)
Signed-off-by: Chris Lamb <lamby@debian.org>
daklib/dbconn.py

index 2f5fef30f9866d2ee158b010fe89ed9cae5d9bb2..39285f0872673cd28c07fd59303bdabb97fa417d 100755 (executable)
@@ -73,9 +73,9 @@ def session_wrapper(fn):
         private_transaction = False
 
         # Find the session object
-        try:
-            session = kwargs['session']
-        except KeyError:
+        session = kwargs.get('session')
+
+        if session is None:
             if len(args) <= len(getargspec(fn)[0]) - 1:
                 # No session specified as last argument or in kwargs
                 private_transaction = True