# HG changeset patch # User Yuya Nishihara # Date 1476969631 -32400 # Node ID f6369544bf851fc367db7efb1676f0cc249fa89b # Parent cb1ea3cc44b5ed8feb42573dd6cdfd02052ee72e mail: do not print(), use ui.debug() instead Since print() can't take a bytes output, it's pretty useless in Mercurial on Python 3. As this is a debug message, switching to ui.debug() seems fine. diff -r cb1ea3cc44b5 -r f6369544bf85 mercurial/mail.py --- a/mercurial/mail.py Thu Oct 20 22:12:48 2016 +0900 +++ b/mercurial/mail.py Thu Oct 20 22:20:31 2016 +0900 @@ -5,7 +5,7 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. -from __future__ import absolute_import, print_function +from __future__ import absolute_import import email import email.charset @@ -14,7 +14,6 @@ import quopri import smtplib import socket -import sys import time from .i18n import _ @@ -87,7 +86,7 @@ def _get_socket(self, host, port, timeout): if self.debuglevel > 0: - print('connect:', (host, port), file=sys.stderr) + self._ui.debug('connect: %r\n' % (host, port)) new_socket = socket.create_connection((host, port), timeout) new_socket = sslutil.wrapsocket(new_socket, self.keyfile, self.certfile,