hgext/convert/darcs.py
changeset 49306 2e726c934fcd
parent 48934 06de08b36c82
child 49370 1572f790ee5e
--- a/hgext/convert/darcs.py	Tue May 31 21:16:17 2022 +0200
+++ b/hgext/convert/darcs.py	Tue May 31 22:50:01 2022 +0200
@@ -5,7 +5,6 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-import errno
 import os
 import re
 import shutil
@@ -230,10 +229,8 @@
         try:
             data = util.readfile(path)
             mode = os.lstat(path).st_mode
-        except IOError as inst:
-            if inst.errno == errno.ENOENT:
-                return None, None
-            raise
+        except FileNotFoundError:
+            return None, None
         mode = (mode & 0o111) and b'x' or b''
         return data, mode