lock: catch specific exceptions
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Sat, 31 Oct 2009 18:10:52 +0100
changeset 9685 a820cd39d415
parent 9684 618af2034ca6
child 9686 ddf2adf88b89
lock: catch specific exceptions
mercurial/lock.py
--- a/mercurial/lock.py	Sat Oct 31 18:02:34 2009 +0100
+++ b/mercurial/lock.py	Sat Oct 31 18:10:52 2009 +0100
@@ -105,7 +105,7 @@
             return locker
         try:
             pid = int(pid)
-        except:
+        except ValueError:
             return locker
         if util.testpid(pid):
             return locker
@@ -128,7 +128,8 @@
                 self.releasefn()
             try:
                 os.unlink(self.f)
-            except: pass
+            except OSError:
+                pass
 
 def release(*locks):
     for lock in locks: