diff mercurial/debugcommands.py @ 49314:2e726c934fcd

py3: catch FileNotFoundError instead of checking errno == ENOENT
author Manuel Jacob <me@manueljacob.de>
date Tue, 31 May 2022 22:50:01 +0200
parents d44e3c45f0e4
children a3fdc4fcb7d2 a3ac3f1623dd
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Tue May 31 21:16:17 2022 +0200
+++ b/mercurial/debugcommands.py	Tue May 31 22:50:01 2022 +0200
@@ -2350,9 +2350,8 @@
                         )
                 ui.writenoi18n(b"%-6s %s (%ds)\n" % (name + b":", locker, age))
                 return 1
-            except OSError as e:
-                if e.errno != errno.ENOENT:
-                    raise
+            except FileNotFoundError:
+                pass
 
         ui.writenoi18n(b"%-6s free\n" % (name + b":"))
         return 0