From 25a56c7669cfdd660472b1bbc6a674113f3346ef Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Tue, 27 Oct 2009 15:18:11 +0000 Subject: [PATCH] If None is passed in. Signed-off-by: Chris Lamb --- daklib/dbconn.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.39.5