diff mercurial/revlogutils/docket.py @ 49306: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 642e31cb55f0
children f04d459909c6
line wrap: on
line diff
--- a/mercurial/revlogutils/docket.py	Tue May 31 21:16:17 2022 +0200
+++ b/mercurial/revlogutils/docket.py	Tue May 31 22:50:01 2022 +0200
@@ -16,7 +16,6 @@
 # * a data file, containing variable width data for these revisions,
 
 
-import errno
 import os
 import random
 import struct
@@ -51,9 +50,7 @@
         try:
             with open(stable_docket_file, mode='rb') as f:
                 seed = f.read().strip()
-        except IOError as inst:
-            if inst.errno != errno.ENOENT:
-                raise
+        except FileNotFoundError:
             seed = b'04'  # chosen by a fair dice roll. garanteed to be random
         iter_seed = iter(seed)
         # some basic circular sum hashing on 64 bits