diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-03-20 00:42:20 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-03-20 00:42:20 (GMT) |
commit | 9a8089b32adee874caefbe2a96096998625c5a78 (patch) | |
tree | bf91050cbe41ad7811a975acc3bab8ed4ee97c02 /Modules/socketmodule.c | |
parent | 4fa99cdb4c5f53d6fa86ef223ae613cb1a8783f8 (diff) | |
download | cpython-9a8089b32adee874caefbe2a96096998625c5a78.zip cpython-9a8089b32adee874caefbe2a96096998625c5a78.tar.gz cpython-9a8089b32adee874caefbe2a96096998625c5a78.tar.bz2 |
Issue #23646: Enhance precision of time.sleep() and socket timeout when
interrupted by a signal
Add a new _PyTime_AddDouble() function and remove _PyTime_ADD_SECONDS() macro.
The _PyTime_ADD_SECONDS only supported an integer number of seconds, the
_PyTime_AddDouble() has subsecond resolution.
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r-- | Modules/socketmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 057430b..480ee5a 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -687,7 +687,7 @@ internal_select(PySocketSockObject *s, int writing) if (has_timeout) { \ _PyTime_monotonic(&now); \ deadline = now; \ - _PyTime_ADD_SECONDS(deadline, s->sock_timeout); \ + _PyTime_AddDouble(&deadline, s->sock_timeout, _PyTime_ROUND_UP); \ } \ while (1) { \ errno = 0; \ |