mercurial/hook.py
changeset 52640 24ee91ba9aa8
parent 51859 f4733654f144
--- a/mercurial/hook.py	Mon Jan 06 14:15:40 2025 -0500
+++ b/mercurial/hook.py	Sun Jan 05 21:03:17 2025 -0500
@@ -313,14 +313,14 @@
         # remote side available to the client immediately.
         try:
             procutil.stderr.flush()
-        except IOError as err:
+        except OSError as err:
             if err.errno not in (errno.EPIPE, errno.EIO, errno.EBADF):
                 raise error.StdioError(err)
 
         if _redirect and oldstdout >= 0:
             try:
                 procutil.stdout.flush()  # write hook output to stderr fd
-            except IOError as err:
+            except OSError as err:
                 if err.errno not in (errno.EPIPE, errno.EIO, errno.EBADF):
                     raise error.StdioError(err)
             os.dup2(oldstdout, stdoutno)