Skip to content

Commit 255b5a6

Browse files
committed
Edit ssl.py slightly
1 parent d3cc360 commit 255b5a6

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

Lib/ssl.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,23 +100,24 @@
100100

101101
import _ssl # if we can't import it, let the error propagate
102102

103-
from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, OPENSSL_VERSION
104-
from _ssl import _SSLContext, MemoryBIO, SSLSession
103+
# XXX RustPython TODO: provide more of these imports
104+
# from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, OPENSSL_VERSION
105+
from _ssl import _SSLContext #, MemoryBIO, SSLSession
105106
from _ssl import (
106-
SSLError, SSLZeroReturnError, SSLWantReadError, SSLWantWriteError,
107-
SSLSyscallError, SSLEOFError,
107+
SSLError, #SSLZeroReturnError, SSLWantReadError, SSLWantWriteError,
108+
# SSLSyscallError, SSLEOFError,
108109
)
109110
from _ssl import txt2obj as _txt2obj, nid2obj as _nid2obj
110-
from _ssl import RAND_status, RAND_add, RAND_bytes, RAND_pseudo_bytes
111+
# from _ssl import RAND_status, RAND_add, RAND_bytes, RAND_pseudo_bytes
111112
try:
112113
from _ssl import RAND_egd
113114
except ImportError:
114115
# LibreSSL does not provide RAND_egd
115116
pass
116117

117118

118-
from _ssl import HAS_SNI, HAS_ECDH, HAS_NPN, HAS_ALPN, HAS_TLSv1_3
119-
from _ssl import _OPENSSL_API_VERSION
119+
# from _ssl import HAS_SNI, HAS_ECDH, HAS_NPN, HAS_ALPN, HAS_TLSv1_3
120+
# from _ssl import _OPENSSL_API_VERSION
120121

121122

122123
_IntEnum._convert(
@@ -969,11 +970,13 @@ def sendall(self, data, flags=0):
969970
"non-zero flags not allowed in calls to sendall() on %s" %
970971
self.__class__)
971972
count = 0
972-
with memoryview(data) as view, view.cast("B") as byte_view:
973-
amount = len(byte_view)
974-
while count < amount:
975-
v = self.send(byte_view[count:])
976-
count += v
973+
# with memoryview(data) as view, view.cast("B") as byte_view:
974+
# XXX RustPython TODO: proper memoryview implementation
975+
byte_view = data
976+
amount = len(byte_view)
977+
while count < amount:
978+
v = self.send(byte_view[count:])
979+
count += v
977980
else:
978981
return socket.sendall(self, data, flags)
979982

0 commit comments

Comments
 (0)