diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-03-30 00:51:13 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-03-30 00:51:13 (GMT) |
commit | ea9c0dd2c27884691f0a0af983fd41d4d818e93f (patch) | |
tree | a8da8821f8fa7c484073538e41b8eb72de384b81 /Modules/_ssl.c | |
parent | 160e819a1d0a01fe79b66bf398c925c0dac0ded1 (diff) | |
download | cpython-ea9c0dd2c27884691f0a0af983fd41d4d818e93f.zip cpython-ea9c0dd2c27884691f0a0af983fd41d4d818e93f.tar.gz cpython-ea9c0dd2c27884691f0a0af983fd41d4d818e93f.tar.bz2 |
Issue #22117: Fix usage of _PyTime_AsTimeval()
Add _PyTime_AsTimeval_noraise() function. Call it when it's not possible (or
not useful) to raise a Python exception on overflow.
Diffstat (limited to 'Modules/_ssl.c')
-rw-r--r-- | Modules/_ssl.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 54f5d14..217c77c 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -1651,9 +1651,7 @@ check_socket_and_wait_for_timeout(PySocketSockObject *s, int writing) if (!_PyIsSelectable_fd(s->sock_fd)) return SOCKET_TOO_LARGE_FOR_SELECT; - /* conversion was already checked for overflow when - the timeout was set */ - (void)_PyTime_AsTimeval(s->sock_timeout, &tv, _PyTime_ROUND_UP); + _PyTime_AsTimeval_noraise(s->sock_timeout, &tv, _PyTime_ROUND_UP); FD_ZERO(&fds); FD_SET(s->sock_fd, &fds); |