changeset 40449:d1bda397df73 stable

selectors2: backport minimal fix of timeout handling from 2.0.1 The original code would raise TypeError since OSError() doesn't support keyword arguments. We can't simply import the selectors 2.0.1, which still spawns "uname -p" through platform.system(). We could switch to the unreleased version, but I decided to not right now to minimize the change.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 03 Dec 2018 21:31:19 +0900
parents d9fc51f77cc5
children 41f0529b5112
files mercurial/thirdparty/selectors2.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/thirdparty/selectors2.py	Wed Nov 14 10:12:43 2018 -0500
+++ b/mercurial/thirdparty/selectors2.py	Mon Dec 03 21:31:19 2018 +0900
@@ -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