Complete.Org: Mailing Lists: Archives: offlineimap: September 2008:
[PATCH] imaplibutil: Remove flagrantly bad use of private attribute
Home

[PATCH] imaplibutil: Remove flagrantly bad use of private attribute

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: offlineimap@xxxxxxxxxxxx
Subject: [PATCH] imaplibutil: Remove flagrantly bad use of private attribute
From: Michael Witten <mfwitten@xxxxxxx>
Date: Fri, 26 Sep 2008 10:43:57 -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@xxxxxxx>
---
 offlineimap/imaplibutil.py |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/offlineimap/imaplibutil.py b/offlineimap/imaplibutil.py
index 23ba654..27ed1fa 100644
--- a/offlineimap/imaplibutil.py
+++ b/offlineimap/imaplibutil.py
@@ -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 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!#$%&'+,.:;<=>?^`|~-]")
-- 
1.6.0.2.302.ge6cbd1




[Prev in Thread] Current Thread [Next in Thread]