diff hgext/releasenotes.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 943509a58d29
line wrap: on
line diff
--- a/hgext/releasenotes.py	Tue May 31 21:16:17 2022 +0200
+++ b/hgext/releasenotes.py	Tue May 31 22:50:01 2022 +0200
@@ -13,7 +13,6 @@
 
 
 import difflib
-import errno
 import re
 
 from mercurial.i18n import _
@@ -688,10 +687,7 @@
     try:
         with open(file_, b'rb') as fh:
             notes = parsereleasenotesfile(sections, fh.read())
-    except IOError as e:
-        if e.errno != errno.ENOENT:
-            raise
-
+    except FileNotFoundError:
         notes = parsedreleasenotes()
 
     notes.merge(ui, incoming)