Skip to content

Commit

Permalink
suppress warning about too many arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
vladak committed Jan 2, 2025
1 parent 58ff51c commit 269d10b
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions adafruit_minimqtt/adafruit_minimqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def username_pw_set(self, username: str, password: Optional[str] = None) -> None
if password is not None:
self._password = password

def connect(
def connect( # noqa: PLR0913, too many arguments in function definition
self,
clean_session: bool = True,
host: Optional[str] = None,
Expand Down Expand Up @@ -464,22 +464,7 @@ def connect(
raise MMQTTException(exc_msg) from last_exception
raise MMQTTException(exc_msg)

def _send_bytes(
self,
buffer: Union[bytes, bytearray, memoryview],
):
bytes_sent: int = 0
bytes_to_send = len(buffer)
view = memoryview(buffer)
while bytes_sent < bytes_to_send:
try:
bytes_sent += self._sock.send(view[bytes_sent:])
except OSError as exc:
if exc.errno == EAGAIN:
continue
raise

def _connect( # noqa: PLR0912, PLR0915, Too many branches, Too many statements
def _connect( # noqa: PLR0912, PLR0913, PLR0915, Too many branches, Too many arguments, Too many statements
self,
clean_session: bool = True,
host: Optional[str] = None,
Expand Down

0 comments on commit 269d10b

Please sign in to comment.