tests/hghave.py
branchstable
changeset 1279 9dac69d57f75
parent 1278 9ff91ff2797d
child 1300 bf0c37b32582
equal deleted inserted replaced
1278:9ff91ff2797d 1279:9dac69d57f75
   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