mail: stop using the smtplib.SSLFakeFile and use socket.socket.makefile
authorAugie Fackler <augie@google.com>
Mon, 16 Jul 2018 18:17:19 -0400
changeset 39026 a5e70c14214a
parent 39025 569d662816de
child 39027 8919cc4f63b4
mail: stop using the smtplib.SSLFakeFile and use socket.socket.makefile They're equivalent, and the latter is what Python 3.3 says to use in the release notes. Turns out it works on Python 2 as well. Differential Revision: https://phab.mercurial-scm.org/D3956
mercurial/mail.py
--- a/mercurial/mail.py	Mon Jul 16 18:16:26 2018 -0400
+++ b/mercurial/mail.py	Mon Jul 16 18:17:19 2018 -0400
@@ -79,7 +79,7 @@
                                         self.keyfile, self.certfile,
                                         ui=self._ui,
                                         serverhostname=self._host)
-        self.file = smtplib.SSLFakeFile(new_socket)
+        self.file = new_socket.makefile(r'rb')
         return new_socket
 
 def _pyhastls():