Kaydet (Commit) 3f73e4c7 authored tarafından Antoine Pitrou's avatar Antoine Pitrou

Fix failure in test_poplib after issue #20951.

üst b8503896
...@@ -349,23 +349,18 @@ class TestPOP3Class(TestCase): ...@@ -349,23 +349,18 @@ class TestPOP3Class(TestCase):
if SUPPORTS_SSL: if SUPPORTS_SSL:
from test.test_ftplib import SSLConnection
class DummyPOP3_SSLHandler(DummyPOP3Handler): class DummyPOP3_SSLHandler(SSLConnection, DummyPOP3Handler):
def __init__(self, conn): def __init__(self, conn):
asynchat.async_chat.__init__(self, conn) asynchat.async_chat.__init__(self, conn)
ssl_socket = ssl.wrap_socket(self.socket, certfile=CERTFILE, self.secure_connection()
server_side=True,
do_handshake_on_connect=False)
self.del_channel()
self.set_socket(ssl_socket)
# Must try handshake before calling push()
self.tls_active = True
self.tls_starting = True
self._do_tls_handshake()
self.set_terminator(b"\r\n") self.set_terminator(b"\r\n")
self.in_buffer = [] self.in_buffer = []
self.push('+OK dummy pop3 server ready. <timestamp>') self.push('+OK dummy pop3 server ready. <timestamp>')
self.tls_active = True
self.tls_starting = False
@requires_ssl @requires_ssl
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment