# HG changeset patch # User Alexis S. L. Carvalho # Date 1171608887 7200 # Node ID 669f99f78db0135f70720b22a05f093cb1a66508 # Parent 4ced663bebf0ddf55161474c9463fe7e3ca0adc3 mail.py: don't try to use TLS if python doesn't have SSL support This should hide the traceback from issue501. diff -r 4ced663bebf0 -r 669f99f78db0 mercurial/mail.py --- a/mercurial/mail.py Fri Feb 16 04:54:46 2007 -0200 +++ b/mercurial/mail.py Fri Feb 16 04:54:47 2007 -0200 @@ -7,7 +7,7 @@ from i18n import gettext as _ from demandload import * -demandload(globals(), "os re smtplib templater util") +demandload(globals(), "os re smtplib templater util socket") def _smtp(ui): '''send mail using smtp.''' @@ -22,6 +22,9 @@ (mailhost, mailport)) s.connect(host=mailhost, port=mailport) if ui.configbool('smtp', 'tls'): + if not hasattr(socket, 'ssl'): + raise util.Abort(_("can't use TLS: Python SSL support " + "not installed")) ui.note(_('(using tls)\n')) s.ehlo() s.starttls()