From 340aad179708ec69d67246f2841859cf8acf603b Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Tue, 18 Jan 2011 00:07:33 -0800 Subject: [PATCH] state.Lock: destructor: unlock before closing, not the other way around. --- state.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/state.py b/state.py index fe814e3..e38cf29 100644 --- a/state.py +++ b/state.py @@ -308,9 +308,9 @@ class Lock: def __del__(self): _locks[self.fid] = 0 - os.close(self.lockfile) if self.owned: self.unlock() + os.close(self.lockfile) def trylock(self): assert(not self.owned)