# HG changeset patch # User Augie Fackler # Date 2018-07-16 22:17:19 # Node ID a5e70c14214a3234b6b33f697741b84e3c44cbd4 # Parent 569d662816de326ff2c687edda586aaedf4cb416 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 diff --git a/mercurial/mail.py b/mercurial/mail.py --- a/mercurial/mail.py +++ b/mercurial/mail.py @@ -79,7 +79,7 @@ class SMTPS(smtplib.SMTP): 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():