]> code.delx.au - offlineimap/commitdiff
imaplibutil: Remove flagrantly bad use of private attribute
authorMichael Witten <mfwitten@MIT.EDU>
Fri, 26 Sep 2008 15:43:57 +0000 (10:43 -0500)
committerJohn Goerzen <jgoerzen@complete.org>
Mon, 29 Sep 2008 22:50:50 +0000 (17:50 -0500)
Frankly, the original code doesn't even make much sense, and
moreover it's not forward compatible with python 2.6, and
furthermore:

    DeprecationWarning: socket.ssl() is deprecated.

So, this commit is just a temporary fix.

Signed-off-by: Michael Witten <mfwitten@mit.edu>
offlineimap/imaplibutil.py

index 23ba654cb3e5ec217d328f1b1727d12ef08b5a25..27ed1fafe824c4becffe4343eeab5f55c3545a8e 100644 (file)
@@ -166,10 +166,7 @@ def new_open_ssl(self, host = '', port = IMAP4_SSL_PORT):
         if last_error != 0:
             # FIXME
             raise socket.error(last_error)
         if last_error != 0:
             # FIXME
             raise socket.error(last_error)
-        if sys.version_info[0] <= 2 and sys.version_info[1] <= 2:
-            self.sslobj = socket.ssl(self.sock, self.keyfile, self.certfile)
-        else:
-            self.sslobj = socket.ssl(self.sock._sock, self.keyfile, self.certfile)
+        self.sslobj = socket.ssl(self.sock, self.keyfile, self.certfile)
         self.sslobj = sslwrapper(self.sslobj)
 
 mustquote = re.compile(r"[^\w!#$%&'+,.:;<=>?^`|~-]")
         self.sslobj = sslwrapper(self.sslobj)
 
 mustquote = re.compile(r"[^\w!#$%&'+,.:;<=>?^`|~-]")