--- a/mercurial/lock.py Sat Oct 31 17:04:46 2009 +0100 +++ b/mercurial/lock.py Sat Oct 31 17:07:12 2009 +0100 @@ -122,7 +122,7 @@ def release(self): if self.held > 1: self.held -= 1 - elif self.held is 1: + elif self.held == 1: self.held = 0 if self.releasefn: self.releasefn()