[Python-checkins] cpython: Fix failure in test_poplib after issue #20951.

antoine.pitrou python-checkins at python.org
Tue Apr 29 10:27:27 CEST 2014


http://hg.python.org/cpython/rev/7f50e1836ddb
changeset:   90509:7f50e1836ddb
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Tue Apr 29 10:27:09 2014 +0200
summary:
  Fix failure in test_poplib after issue #20951.

files:
  Lib/test/test_poplib.py |  15 +++++----------
  1 files changed, 5 insertions(+), 10 deletions(-)


diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py
--- a/Lib/test/test_poplib.py
+++ b/Lib/test/test_poplib.py
@@ -349,23 +349,18 @@
 
 
 if SUPPORTS_SSL:
+    from test.test_ftplib import SSLConnection
 
-    class DummyPOP3_SSLHandler(DummyPOP3Handler):
+    class DummyPOP3_SSLHandler(SSLConnection, DummyPOP3Handler):
 
         def __init__(self, conn):
             asynchat.async_chat.__init__(self, conn)
-            ssl_socket = ssl.wrap_socket(self.socket, certfile=CERTFILE,
-                                          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.secure_connection()
             self.set_terminator(b"\r\n")
             self.in_buffer = []
             self.push('+OK dummy pop3 server ready. <timestamp>')
+            self.tls_active = True
+            self.tls_starting = False
 
 
 @requires_ssl

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list