Author: Ronan Lamy <ronan.l...@gmail.com>
Branch: py3.5
Changeset: r91653:579fe19f0246
Date: 2017-06-27 19:43 +0100
http://bitbucket.org/pypy/pypy/changeset/579fe19f0246/

Log:    Fix #2578, but (I guess) only on POSIX

diff --git a/lib_pypy/_cffi_ssl/_stdssl/error.py 
b/lib_pypy/_cffi_ssl/_stdssl/error.py
--- a/lib_pypy/_cffi_ssl/_stdssl/error.py
+++ b/lib_pypy/_cffi_ssl/_stdssl/error.py
@@ -1,4 +1,5 @@
 import sys
+import os
 import traceback
 from _pypy_openssl import ffi
 from _pypy_openssl import lib
@@ -100,18 +101,17 @@
             errval = SSL_ERROR_WANT_CONNECT
         elif err == SSL_ERROR_SYSCALL:
             if e == 0:
-                if ret == 0 or obj.socket is not None:
+                if ret == 0 or obj.socket is None:
                     errtype = SSLEOFError
                     errstr = "EOF occurred in violation of protocol"
                     errval = SSL_ERROR_EOF
                 elif ret == -1 and obj.socket is not None:
                     # the underlying BIO reported an I/0 error
                     lib.ERR_clear_error()
-                    s = obj.get_socket_or_None()
-                    s.errorhandler()
-                    assert 0, "must not get here"
-                    #errno = ffi.errno
-                    #return IOError(errno)
+                    # s = obj.get_socket_or_None()
+                    # XXX: Windows?
+                    errno = ffi.errno
+                    return OSError(errno, os.strerror(errno))
                 else:
                     errtype = SSLSyscallError
                     errstr = "Some I/O error occurred"
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to