tests/hghave.py
changeset 19378 9de689d20230
parent 19092 8c560ad1cdc4
child 19930 b8316878a685
equal deleted inserted replaced
19377:0cb996ee8c6d 19378:9de689d20230
   103         return False
   103         return False
   104     name = tempfile.mktemp(dir='.', prefix=tempprefix)
   104     name = tempfile.mktemp(dir='.', prefix=tempprefix)
   105     sock = socket.socket(socket.AF_UNIX)
   105     sock = socket.socket(socket.AF_UNIX)
   106     try:
   106     try:
   107         sock.bind(name)
   107         sock.bind(name)
   108     except socket.error, err:
   108     except socket.error:
   109         return False
   109         return False
   110     sock.close()
   110     sock.close()
   111     os.unlink(name)
   111     os.unlink(name)
   112     return True
   112     return True
   113 
   113