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.
--- 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'))