comparison mercurial/mail.py @ 39028:713126389ef2

mail: fix debug print, which appears to have been broken for a long time I noticed this when trying to debug very mysterious dummysmtpd problems. It turns out you can set self.debuglevel to a number greater than 0 and have smtplib print helpful debug output, but this output on our side of things was broken. Differential Revision: https://phab.mercurial-scm.org/D4218
author Augie Fackler <augie@google.com>
date Thu, 09 Aug 2018 17:44:36 -0400
parents a5e70c14214a
children 2cf3bd4ae55e
comparison
equal deleted inserted replaced
39027:8919cc4f63b4 39028:713126389ef2
71 self.default_port = smtplib.SMTP_SSL_PORT 71 self.default_port = smtplib.SMTP_SSL_PORT
72 self._ui = ui 72 self._ui = ui
73 73
74 def _get_socket(self, host, port, timeout): 74 def _get_socket(self, host, port, timeout):
75 if self.debuglevel > 0: 75 if self.debuglevel > 0:
76 self._ui.debug('connect: %r\n' % (host, port)) 76 self._ui.debug('connect: %r\n' % ((host, port),))
77 new_socket = socket.create_connection((host, port), timeout) 77 new_socket = socket.create_connection((host, port), timeout)
78 new_socket = sslutil.wrapsocket(new_socket, 78 new_socket = sslutil.wrapsocket(new_socket,
79 self.keyfile, self.certfile, 79 self.keyfile, self.certfile,
80 ui=self._ui, 80 ui=self._ui,
81 serverhostname=self._host) 81 serverhostname=self._host)