mercurial/lock.py
branchstable
changeset 17682 829919ef894a
parent 15589 cc24e4ed3e0c
child 17683 6d7db5794e8c
--- a/mercurial/lock.py	Sat Sep 29 13:33:55 2012 +0200
+++ b/mercurial/lock.py	Thu Sep 27 14:38:03 2012 -0700
@@ -97,7 +97,12 @@
         The lock file is only deleted when None is returned.
 
         """
-        locker = util.readlock(self.f)
+        try:
+            locker = util.readlock(self.f)
+        except OSError, why:
+            if why.errno == errno.ENOENT:
+                return None
+            raise
         try:
             host, pid = locker.split(":", 1)
         except ValueError: