mercurial/lock.py
changeset 49306 2e726c934fcd
parent 48946 642e31cb55f0
child 49310 050dc8730858
--- a/mercurial/lock.py	Tue May 31 21:16:17 2022 +0200
+++ b/mercurial/lock.py	Tue May 31 22:50:01 2022 +0200
@@ -311,10 +311,8 @@
         """
         try:
             return self.vfs.readlock(self.f)
-        except (OSError, IOError) as why:
-            if why.errno == errno.ENOENT:
-                return None
-            raise
+        except FileNotFoundError:
+            return None
 
     def _lockshouldbebroken(self, locker):
         if locker is None: