def write(self, data):
        """\
        Output the given byte string over the serial port. Can block if the
        connection is blocked. May raise SerialException if the connection is
        closed.
        """
        if not self.is_open:
            raise portNotOpenError
        data = to_bytes(data)
        # calculate aprox time that would be used to send the data
        time_used_to_send = 10.0 * len(data) / self._baudrate
        # when a write timeout is configured check if we would be successful
        # (not sending anything, not even the part that would have time)
        if self._write_timeout is not None and self._write_timeout > time_used_to_send:
            time.sleep(self._write_timeout)  # must wait so that unit test succeeds
            raise writeTimeoutError
        for byte in iterbytes(data):
            self.queue.put(byte, timeout=self._write_timeout)
        return len(data)
dataset/ETHPy150Open pyserial/pyserial/serial/urlhandler/protocol_loop.py/Serial.write/swapped operands of `>`