diff options
Diffstat (limited to 'Lib/smtplib.py')
-rwxr-xr-x | Lib/smtplib.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py index 7423ae0..5e4ebe8 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -161,7 +161,6 @@ try: except ImportError: _have_ssl = False else: - class SSLFakeFile: """A fake file like object that really wraps a SSLObject. @@ -722,9 +721,8 @@ if _have_ssl: def _get_socket(self, host, port, timeout): if self.debuglevel > 0: print('connect:', (host, port), file=stderr) self.sock = socket.create_connection((host, port), timeout) - sslobj = socket.ssl(self.sock, self.keyfile, self.certfile) - self.sock = SSLFakeSocket(self.sock, sslobj) - self.file = SSLFakeFile(sslobj) + self.sock = ssl.sslsocket(self.sock, self.keyfile, self.certfile) + self.file = SSLFakeFile(self.sock) __all__.append("SMTP_SSL") |