mercurial/httppeer.py
changeset 52640 24ee91ba9aa8
parent 52521 b52f2b365eff
child 52643 5cc8deb96b48
--- a/mercurial/httppeer.py	Mon Jan 06 14:15:40 2025 -0500
+++ b/mercurial/httppeer.py	Sun Jan 05 21:03:17 2025 -0500
@@ -11,7 +11,6 @@
 import errno
 import io
 import os
-import socket
 import struct
 import typing
 
@@ -303,7 +302,7 @@
             % urlutil.hidepassword(req.get_full_url())
         )
         ui.traceback()
-        raise IOError(None, inst)
+        raise OSError(None, inst)
     finally:
         if ui.debugflag and ui.configbool(b'devel', b'debug.peer-request'):
             code = res.code if res else -1
@@ -522,7 +521,7 @@
             # like generic socket errors. They lack any values in
             # .args on Python 3 which breaks our socket.error block.
             raise
-        except socket.error as err:
+        except OSError as err:
             if err.args[0] in (errno.ECONNRESET, errno.EPIPE):
                 raise error.Abort(_(b'push failed: %s') % err.args[1])
             raise error.Abort(err.args[1])