From: Chris Lamb Date: Tue, 27 Oct 2009 15:18:11 +0000 (+0000) Subject: If None is passed in. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25a56c7669cfdd660472b1bbc6a674113f3346ef;p=dak If None is passed in. Signed-off-by: Chris Lamb --- diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 2f5fef30..39285f08 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -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