diff --git a/mercurial/thirdparty/selectors2.py b/mercurial/thirdparty/selectors2.py
index d9fc51f77cc558f4a687f51e5ebd7d424688f917_bWVyY3VyaWFsL3RoaXJkcGFydHkvc2VsZWN0b3JzMi5weQ==..d1bda397df7330fb192a94dcb0801928a2492074_bWVyY3VyaWFsL3RoaXJkcGFydHkvc2VsZWN0b3JzMi5weQ== 100644
--- a/mercurial/thirdparty/selectors2.py
+++ b/mercurial/thirdparty/selectors2.py
@@ -708,7 +708,7 @@
                     if expires is not None:
                         current_time = monotonic()
                         if current_time > expires:
-                            raise OSError(errno=errno.ETIMEDOUT)
+                            raise OSError(errno.ETIMEDOUT, 'Connection timed out')
                         if recalc_timeout:
                             if "timeout" in kwargs:
                                 kwargs["timeout"] = expires - current_time