D3956: mail: stop using the smtplib.SSLFakeFile and use socket.socket.makefile

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Mon Jul 16 23:16:26 UTC 2018


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3956

AFFECTED FILES
  mercurial/mail.py

CHANGE DETAILS

diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -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()
         return new_socket
 
 def _pyhastls():



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list