Mercurial > hg
changeset 881:16ce690c411d
Fix problem with "hg serve" on systems not providing IPv6.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Wed, 10 Aug 2005 12:35:25 -0800 |
parents | 6390c377a9e6 |
children | bc9ca4d51d23 |
files | mercurial/hgweb.py |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hgweb.py Tue Aug 09 09:36:34 2005 -0800 +++ b/mercurial/hgweb.py Wed Aug 10 12:35:25 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):