def _reconnect_target(self, init=False, dotu=1):
        """
        Reconnection thread code.
        """
        while True:
            try:
                self.sock.close()
            except:
                pass

            try:
                if self.debug:
                    print("trying to connect")
                if self.address[0].find("/") > -1:
                    self.sock = socket.socket(socket.AF_UNIX)
                else:
                    self.sock = socket.socket(socket.AF_INET)
                self.sock.settimeout(self.timeout)
                self.sock.connect(self.address)
                self.client = py9p.Client(
                        fd=self.sock,
                        chatty=self.debug,
                        credentials=self.credentials,
                        dotu=dotu, msize=self.msize)
                self.msize = self.client.msize
                self.fidcache.iounit = py9p.IOHDRSZ - self.client.msize
                self._connected_event.set()
                self._lock.release()
                return
            except py9p.VersionError:
                if dotu:
                    self.dotu = 0
                    self._reconnect_target(init, 0)
                else:
                    self.exit = Exception("protocol negotiation error")
                return
            except Exception as e:
                if self.keep_reconnect:
                    if init:
                        # if we get an error on the very initial
                        # time, just fake the connection --
                        # next reconnect round will be triggered
                        # by the next failed FS call
                        self._lock.release()
                        self._connected_event.set()
                        return
                    s = self._reconnect_interval()
                    if self.debug:
                        print("reconnect in %s seconds" % (s))
                    self._reconnect_event.wait(s)
                    self._reconnect_event.clear()
                else:
                    self.exit = e
                    self._lock.release()
                    self._connected_event.set()
                    return
dataset/ETHPy150Open svinota/py9p/py9p/fuse9p.py/ClientFS._reconnect_target/swapped operands of `-`