[pypy-commit] pypy default: poll can fail. Raise SSLError in that case

fijal noreply at buildbot.pypy.org
Thu Sep 11 18:57:01 CEST 2014


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r73460:8a07f6d2a9a0
Date: 2014-09-11 10:56 -0600
http://bitbucket.org/pypy/pypy/changeset/8a07f6d2a9a0/

Log:	poll can fail. Raise SSLError in that case

diff --git a/pypy/module/_ssl/interp_ssl.py b/pypy/module/_ssl/interp_ssl.py
--- a/pypy/module/_ssl/interp_ssl.py
+++ b/pypy/module/_ssl/interp_ssl.py
@@ -759,7 +759,11 @@
 
         # socket's timeout is in seconds, poll's timeout in ms
         timeout = int(sock_timeout * 1000 + 0.5)
-        ready = rpoll.poll(fddict, timeout)
+        try:
+            ready = rpoll.poll(fddict, timeout)
+        except rpoll.PollError, e:
+            message = e.get_msg()
+            raise ssl_error(space, message, e.errno)
     else:
         if MAX_FD_SIZE is not None and sock_fd >= MAX_FD_SIZE:
             return SOCKET_TOO_LARGE_FOR_SELECT


More information about the pypy-commit mailing list