# HG changeset patch # User Mads Kiilerich # Date 1317142270 -7200 # Node ID b2d4400398f379dd7865ffa7f5424fd826509ee2 # Parent 91dc8878f88857f01b86a99ad047400704b5fd7e sslutil: abort when ssl module is needed but not found It is apparently possible to compile Python without SSL support or leave it out when installing precompiled binaries. Mercurial on such Pythons would crash if the user tried to use https. Now it will be reported as "abort: Python SSL support not found" instead. diff -r 91dc8878f888 -r b2d4400398f3 mercurial/sslutil.py --- a/mercurial/sslutil.py Thu Sep 22 15:15:18 2011 +0200 +++ b/mercurial/sslutil.py Tue Sep 27 18:51:10 2011 +0200 @@ -22,6 +22,8 @@ def ssl_wrap_socket(sock, key_file, cert_file, cert_reqs=CERT_REQUIRED, ca_certs=None): + if not util.safehasattr(socket, 'ssl'): + raise util.Abort(_('Python SSL support not found')) if ca_certs: raise util.Abort(_( 'certificate checking requires Python 2.6'))