def _bind_by_none(self, socket):
    with self.lock:
        try:
            addr = (32 + self.sap[32:64].index(None))
        except ValueError:
            raise Error(errno.EAGAIN)
        else:
            socket.bind(addr)
            self.sap[addr] = ServiceAccessPoint(addr, self)
            self.sap[addr].insert_socket(socket)
def _bind_by_none(self, socket):
    with self.lock:
        try:
            addr = (32 + self.sap[32:64].index(None))
        except ValueError:
            raise Error(errno.EAGAIN)
        else:
            socket.bind(addr)
            self.sap[addr] = ServiceAccessPoint(addr, self)
            self.sap[addr].insert_socket(socket)