Merge IPv6 fix.
authorBryan O'Sullivan <bos@serpentine.com>
Wed, 10 Aug 2005 12:36:34 -0800
changeset 882 bc9ca4d51d23
parent 871 c2e77581bc84 (current diff)
parent 881 16ce690c411d (diff)
child 883 63ca8a68d59e
Merge IPv6 fix.
.hgignore
CONTRIBUTORS
TODO
doc/hg.1.txt
mercurial/commands.py
mercurial/hg.py
mercurial/hgweb.py
mercurial/revlog.py
mercurial/util.py
templates/map
tests/test-help
tests/test-help.out
--- a/mercurial/hgweb.py	Tue Aug 09 17:24:38 2005 -0800
+++ b/mercurial/hgweb.py	Wed Aug 10 12:36:34 2005 -0800
@@ -708,7 +708,12 @@
     import BaseHTTPServer
 
     class IPv6HTTPServer(BaseHTTPServer.HTTPServer):
-        address_family = socket.AF_INET6
+        address_family = getattr(socket, 'AF_INET6', None)
+
+        def __init__(self, *args, **kwargs):
+            if self.address_family is None:
+                raise RepoError('IPv6 not available on this system')
+            BaseHTTPServer.HTTPServer.__init__(self, *args, **kwargs)
 
     class hgwebhandler(BaseHTTPServer.BaseHTTPRequestHandler):
         def log_error(self, format, *args):