diff -r 9db77d46de79 -r 24ee91ba9aa8 mercurial/win32.py --- a/mercurial/win32.py Mon Jan 06 14:15:40 2025 -0500 +++ b/mercurial/win32.py Sun Jan 05 21:03:17 2025 -0500 @@ -718,7 +718,7 @@ if os.path.isdir(path): # use EPERM because it is POSIX prescribed value, even though # unlink(2) on directories returns EISDIR on Linux - raise IOError( + raise OSError( errno.EPERM, r"Unlinking directory not permitted: '%s'" % encoding.strfromlocal(path), @@ -749,7 +749,7 @@ except FileExistsError: pass else: - raise IOError(errno.EEXIST, "No usable temporary filename found") + raise OSError(errno.EEXIST, "No usable temporary filename found") try: os.unlink(temp)