Commit 67ffec1f authored by Jeremy Hylton's avatar Jeremy Hylton

Get rid of default argument optimization.

parent ed847de9
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
############################################################################## ##############################################################################
"""Transaction management """Transaction management
$Id: Transaction.py,v 1.51 2003/10/02 20:17:36 jeremy Exp $ $Id: Transaction.py,v 1.52 2003/10/02 22:11:28 jeremy Exp $
""" """
import sys import sys
...@@ -459,24 +459,24 @@ try: ...@@ -459,24 +459,24 @@ try:
except: except:
_t = Transaction(None) _t = Transaction(None)
def get_transaction(_t=_t): def get_transaction():
return _t return _t
def free_transaction(_t=_t): def free_transaction():
_t.__init__() _t.__init__()
else: else:
_t = {} _t = {}
def get_transaction(_id=thread.get_ident, _t=_t, get=_t.get): def get_transaction():
id = _id() id = thread.get_ident()
t = get(id, None) t = _t.get(id, None)
if t is None: if t is None:
_t[id] = t = Transaction(id) _t[id] = t = Transaction(id)
return t return t
def free_transaction(_id=thread.get_ident, _t=_t): def free_transaction():
id = _id() id = thread.get_ident()
try: try:
del _t[id] del _t[id]
except KeyError: except KeyError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment