state.Lock: initialize self.owner first, to avoid problems in __del__

...if an exception is ever thrown in _sname().  Which shouldn't happen, but
we might as well be careful.
This commit is contained in:
Avery Pennarun 2010-11-21 03:57:52 -08:00
commit cd702a8126

View file

@ -109,9 +109,9 @@ def start(t):
class Lock:
def __init__(self, t):
self.owned = False
self.lockname = _sname('lock', t)
self.tmpname = _sname('lock%d' % os.getpid(), t)
self.owned = False
def __del__(self):
if self.owned: