From: Chris Lamb Date: Tue, 27 Oct 2009 15:26:01 +0000 (+0000) Subject: If positional argument is None, modify it.s X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5f216eb3e4035e726eb0a708a0d9ec944c0061f;p=dak If positional argument is None, modify it.s --- diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 39285f08..adecc38a 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -83,6 +83,9 @@ def session_wrapper(fn): else: # Session is last argument in args session = args[-1] + if session is None: + session = args[-1] = DBConn().session() + private_transaction = True if private_transaction: session.commit_or_flush = session.commit