Commit 2b790fba authored by Tim Peters's avatar Tim Peters

Oops! synchs can be None. Reported by Gary Poster.

parent 9b42a5e0
...@@ -33,14 +33,15 @@ from transaction._transaction import Transaction ...@@ -33,14 +33,15 @@ from transaction._transaction import Transaction
# at top level here. # at top level here.
# Call the ISynchronizer newTransaction() method on every element of # Call the ISynchronizer newTransaction() method on every element of
# WeakSet synchs. # WeakSet synchs (or skip it if synchs is None).
# A transaction manager needs to do this whenever begin() is called. # A transaction manager needs to do this whenever begin() is called.
# Since it would be good if tm.get() returned the new transaction while # Since it would be good if tm.get() returned the new transaction while
# newTransaction() is running, calling this has to be delayed until after # newTransaction() is running, calling this has to be delayed until after
# the transaction manager has done whatever it needs to do to make its # the transaction manager has done whatever it needs to do to make its
# get() return the new txn. # get() return the new txn.
def _new_transaction(txn, synchs): def _new_transaction(txn, synchs):
synchs.map(lambda s: s.newTransaction(txn)) if synchs:
synchs.map(lambda s: s.newTransaction(txn))
class TransactionManager(object): class TransactionManager(object):
......
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