Fix compatibility with return value of SSLSocket.sendall in python >= 3.6.

https://bugs.python.org/issue25951
This commit is contained in:
Valentin Lorentz 2021-02-14 23:18:45 +01:00
parent e45a1fb9db
commit f0141b0a93

View File

@ -1,4 +1,5 @@
import ssl
import sys
import time
import socket
from .irc_utils import message_parser
@ -104,7 +105,7 @@ class ClientMock:
ret = self.conn.sendall(encoded_line)
except BrokenPipeError:
raise ConnectionClosed()
if self.ssl: # https://bugs.python.org/issue25951
if sys.version_info <= (3, 6) and self.ssl: # https://bugs.python.org/issue25951
assert ret == len(encoded_line), (ret, repr(encoded_line))
else:
assert ret is None, ret