mercurial/mail.py
changeset 4096 49237d6ae97d
parent 3963 ba45041827a2
parent 4093 669f99f78db0
child 4489 a11e13d50645
--- a/mercurial/mail.py	Thu Feb 15 10:15:08 2007 -0200
+++ b/mercurial/mail.py	Fri Feb 16 05:27:37 2007 -0200
@@ -6,7 +6,7 @@
 # of the GNU General Public License, incorporated herein by reference.
 
 from i18n import _
-import os, smtplib, templater, util
+import os, smtplib, templater, util, socket
 
 def _smtp(ui):
     '''send mail using smtp.'''
@@ -21,6 +21,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()