# Pastebin cEwhQzWC def _PySSL_errno(failed, ssl, retcode): class ErrState(): ws = 0 c = 0 ssl = 0 err = ErrState() if failed: if sys.platform == 'win32': err.ws = lib.WSAGetLastError() err.c = ffi.errno err.ssl = lib.SSL_get_error(ssl, retcode) return err