def _finishIntent(self, intent, status=SendStatus.Sent):
        if hasattr(intent, 'socket'):
            if hasattr(self, '_openSockets'):
                extraRead = getattr(intent, 'extraRead', None)
                if extraRead:
                    incoming = TCPIncomingPersistent(intent.targetAddr, intent.socket)
                    incoming.addData(extraRead)
                    pendingIncoming = self._addedDataToIncoming(incoming)
                    if pendingIncoming:
                        self._incomingSockets[pendingIncoming.socket.fileno()] = \
                            pendingIncoming
                else:
                    if status == SendStatus.Sent:
                        if self._openSockets in intent.targetAddr:
                            _safeSocketShutdown(self._openSockets[intent.targetAddr].socket)
                        self._openSockets[intent.targetAddr] = IdleSocket(intent.socket)
                        # No need to restart a pending transmit for
                        # this target here; the main loop will check
                        # the waitingIntents and find/start the next one
                        # automatically.
                    else:
                        _safeSocketShutdown(intent.socket)
                        # Here waiting intents need to be re-queued
                        # since otherwise they won't run until timeout
                        runnable, waiting = partition(lambda I: I.targetAddr == intent.targetAddr,
                                                      self._waitingTransmits)
                        self._waitingTransmits = waiting
                        for R in runnable:
                            if status == SendStatus.DeadTarget:
                                R.result = status
                                R.completionCallback()
                            elif self._nextTransmitStep(R):
                                if hasattr(R, 'socket'):
                                    thesplog('<S> waiting intent is now re-processing: %s', R.identify())
                                    self._transmitIntents[R.socket.fileno()] = R
                                else:
                                    self._waitingTransmits.append(R)
            else:
                _safeSocketShutdown(intent.socket)
            delattr(intent, 'socket')
        intent.result = status
        intent.completionCallback()
        return False  # intent no longer needs to be attempted
dataset/ETHPy150Open godaddy/Thespian/thespian/system/transport/TCPTransport.py/TCPTransport._finishIntent/swapped operands of `in`