--- a/hgext/share.py Tue May 31 21:16:17 2022 +0200
+++ b/hgext/share.py Tue May 31 22:50:01 2022 +0200
@@ -66,7 +66,6 @@
'''
-import errno
from mercurial.i18n import _
from mercurial import (
bookmarks,
@@ -177,9 +176,7 @@
return False
try:
shared = repo.vfs.read(b'shared').splitlines()
- except IOError as inst:
- if inst.errno != errno.ENOENT:
- raise
+ except FileNotFoundError:
return False
return hg.sharedbookmarks in shared
@@ -199,9 +196,8 @@
# is up-to-date.
return fp
fp.close()
- except IOError as inst:
- if inst.errno != errno.ENOENT:
- raise
+ except FileNotFoundError:
+ pass
# otherwise, we should read bookmarks from srcrepo,
# because .hg/bookmarks in srcrepo might be already