mercurial/hgweb.py
changeset 883 63ca8a68d59e
parent 871 c2e77581bc84
parent 882 bc9ca4d51d23
child 885 6594ba2a0f51
child 887 882756761433
child 890 391de0bcc722
child 894 62ec665759f2
equal deleted inserted replaced
880:409a9a7b0da2 883:63ca8a68d59e
   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(),