PKGBUILDs/extra/python/python-2.6-smtplib.patch

18 lines
794 B
Diff
Raw Normal View History

2009-09-26 14:35:50 +00:00
Index: Lib/smtplib.py
===================================================================
--- Lib/smtplib.py (revision 72551)
+++ Lib/smtplib.py (working copy)
@@ -751,9 +751,10 @@
def _get_socket(self, host, port, timeout):
if self.debuglevel > 0: print>>stderr, 'connect:', (host, port)
- self.sock = socket.create_connection((host, port), timeout)
- self.sock = ssl.wrap_socket(self.sock, self.keyfile, self.certfile)
- self.file = SSLFakeFile(self.sock)
+ new_socket = socket.create_connection((host, port), timeout)
+ new_socket = ssl.wrap_socket(new_socket, self.keyfile, self.certfile)
+ self.file = SSLFakeFile(new_socket)
+ return new_socket
__all__.append("SMTP_SSL")