mercurial/hgweb.py
changeset 885 6594ba2a0f51
parent 878 781266a78fe1
parent 883 63ca8a68d59e
child 887 882756761433
--- a/mercurial/hgweb.py	Fri Aug 12 10:17:12 2005 -0800
+++ b/mercurial/hgweb.py	Fri Aug 12 11:18:41 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):