rpms/offlineimap/F-11 fix-socket.ssl-deprecation-on-python-2.6.patch, NONE, 1.1
Christoph Höger
choeger at fedoraproject.org
Thu Jul 2 18:11:04 UTC 2009
Author: choeger
Update of /cvs/pkgs/rpms/offlineimap/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16305
Added Files:
fix-socket.ssl-deprecation-on-python-2.6.patch
Log Message:
add missing patch
fix-socket.ssl-deprecation-on-python-2.6.patch:
--- NEW FILE fix-socket.ssl-deprecation-on-python-2.6.patch ---
commit cc444fcc99d1521e4e4fa1fede27ea3c1c8ff4e2
Author: Christoph Höger <choeger at cs.tu-berlin.de>
Date: Thu Jul 2 10:19:18 2009 +0200
fix socket.ssl deprecation on python 2.6
Signed-off-by: Christoph Höger <choeger at cs.tu-berlin.de>
diff --git a/offlineimap/imaplib2.py b/offlineimap/imaplib2.py
index 2426754..658c369 100644
--- a/offlineimap/imaplib2.py
+++ b/offlineimap/imaplib2.py
@@ -35,6 +35,9 @@ __author__ = "Piers Lauder <piers at janeelix.com>"
import binascii, os, Queue, random, re, select, socket, sys, time, threading
+# python 2.6 has a new ssl module
+if sys.version_info >= (2,6): import ssl
+
select_module = select
# Globals
@@ -1664,7 +1667,10 @@ class IMAP4_SSL(IMAP4):
self.host = host is not None and host or ''
self.port = port is not None and port or IMAP4_SSL_PORT
self.sock = self.open_socket()
- self.sslobj = socket.ssl(self.sock, self.keyfile, self.certfile)
+ if sys.version_info < (2,6):
+ self.sslobj = socket.ssl(self.sock, self.keyfile, self.certfile)
+ else:
+ self.sslobj = ssl.wrap_socket(self.sock, self.keyfile, self.certfile)
self.read_fd = self.sock.fileno()
More information about the fedora-extras-commits
mailing list