[PATCH 1 of 2] sslutil: Restore missing imports of socket and httplib to sslutil

Stephen Thorne stephen at thorne.id.au
Mon Jun 13 22:32:25 CDT 2011


# HG changeset patch
# User Stephen Thorne <stephen at thorne.id.au>
# Date 1308022292 -36000
# Node ID 6a28d54139bdcc49820978ed0c292d8d8c19123f
# Parent  b72cef1b8b26262f627423c16b5c09396721b220
sslutil: Restore missing imports of socket and httplib to sslutil

Two imports were omitted in the restructure of the code creating
sslutil.py, socket and httplib are required when the 'ssl' module
cannot be imported, restoring these imports allows mercurial to run
on python2.4+2.5.

diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py
--- a/mercurial/sslutil.py
+++ b/mercurial/sslutil.py
@@ -18,6 +18,8 @@ try:
 except ImportError:
     CERT_REQUIRED = 2
 
+    import socket, httplib
+
     def ssl_wrap_socket(sock, key_file, cert_file,
                         cert_reqs=CERT_REQUIRED, ca_certs=None):
         if ca_certs:


More information about the Mercurial-devel mailing list