]> khamidou — GitHub mirrors - imapclient.git/commitdiff
moved the internal _SSLConnection class further down the file
authorMenno Smits <menno@freshfoo.com>
Fri, 23 Jan 2015 10:35:55 +0000 (23:35 +1300)
committerMenno Smits <menno@freshfoo.com>
Fri, 23 Jan 2015 10:35:55 +0000 (23:35 +1300)
imapclient/tls.py

index ed1127cfa47c01700072e4588c4fe64063666260..895ad201732bf0026e1652f8ce08a1eb6327141b 100644 (file)
@@ -95,20 +95,8 @@ def get_default_context(cafile=None, capath=None, check_hostname=True):
     return context
 
 
-class _SSLConnection(SSL.Connection):
-    """Wrapper for OpenSSL.SSL.Connection for socket compatibility."""
-
-    def shutdown(self, *args):
-        # Fix method signature incompatibility bewteen pyOpenSSL.SSL.Connection
-        # and socket.socket
-        SSL.Connection.shutdown(self)
-
-    def makefile(self, mode='rb', *args, **kwargs):
-        # Support only arguments needed by imaplib
-        return _socketfileobj(self, mode)
-
-
 class IMAP4(imaplib.IMAP4):
+
     def starttls(self, ssl_context=None):
         """Send a STARTTLS command and wrap the socket with TLS."""
         name = 'STARTTLS'
@@ -147,6 +135,19 @@ class IMAP4(imaplib.IMAP4):
         return self._untagged_response(type_, dat, name)
 
 
+class _SSLConnection(SSL.Connection):
+    """Wrapper for OpenSSL.SSL.Connection for socket compatibility."""
+
+    def shutdown(self, *args):
+        # Fix method signature incompatibility bewteen pyOpenSSL.SSL.Connection
+        # and socket.socket
+        SSL.Connection.shutdown(self)
+
+    def makefile(self, mode='rb', *args, **kwargs):
+        # Support only arguments needed by imaplib
+        return _socketfileobj(self, mode)
+
+
 # lifted from backports.ssl
 class _socketfileobj(object):
     """Custom file-like object to support socket.makefile for pyOpenSSL."""