mercurial/hgweb.py
changeset 882 bc9ca4d51d23
parent 871 c2e77581bc84
parent 881 16ce690c411d
child 883 63ca8a68d59e
equal deleted inserted replaced
871:c2e77581bc84 882:bc9ca4d51d23
   706                   accesslog = sys.stdout, errorlog = sys.stderr):
   706                   accesslog = sys.stdout, errorlog = sys.stderr):
   707 
   707 
   708     import BaseHTTPServer
   708     import BaseHTTPServer
   709 
   709 
   710     class IPv6HTTPServer(BaseHTTPServer.HTTPServer):
   710     class IPv6HTTPServer(BaseHTTPServer.HTTPServer):
   711         address_family = socket.AF_INET6
   711         address_family = getattr(socket, 'AF_INET6', None)
       
   712 
       
   713         def __init__(self, *args, **kwargs):
       
   714             if self.address_family is None:
       
   715                 raise RepoError('IPv6 not available on this system')
       
   716             BaseHTTPServer.HTTPServer.__init__(self, *args, **kwargs)
   712 
   717 
   713     class hgwebhandler(BaseHTTPServer.BaseHTTPRequestHandler):
   718     class hgwebhandler(BaseHTTPServer.BaseHTTPRequestHandler):
   714         def log_error(self, format, *args):
   719         def log_error(self, format, *args):
   715             errorlog.write("%s - - [%s] %s\n" % (self.address_string(),
   720             errorlog.write("%s - - [%s] %s\n" % (self.address_string(),
   716                                                  self.log_date_time_string(),
   721                                                  self.log_date_time_string(),