diff -r 9db77d46de79 -r 24ee91ba9aa8 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Mon Jan 06 14:15:40 2025 -0500 +++ b/mercurial/cmdutil.py Sun Jan 05 21:03:17 2025 -0500 @@ -1163,7 +1163,7 @@ message = ui.fin.read() else: message = b'\n'.join(util.readfile(logfile).splitlines()) - except IOError as inst: + except OSError as inst: raise error.Abort( _(b"can't read commit message '%s': %s") % (logfile, encoding.strtolocal(inst.strerror)) @@ -1796,7 +1796,7 @@ # Linux CLI behavior. util.copyfile(src, target, copystat=rename) srcexists = True - except IOError as inst: + except OSError as inst: if inst.errno == errno.ENOENT: ui.warn(_(b'%s: deleted in working directory\n') % relsrc) srcexists = False