Skip to content

Commit c0a902a

Browse files
committed
use f-strings for the exceptions
pylint will like the code more
1 parent f0fd465 commit c0a902a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

adafruit_minimqtt/adafruit_minimqtt.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -974,9 +974,7 @@ def _sock_exact_recv(self, bufsize):
974974
mv = mv[recv_len:]
975975
if time.monotonic() - stamp > read_timeout:
976976
raise MMQTTException(
977-
"Unable to receive {} bytes within {} seconds.".format(
978-
to_read, read_timeout
979-
)
977+
f"Unable to receive {to_read} bytes within {read_timeout} seconds."
980978
)
981979
else: # ESP32SPI Impl.
982980
# This will timeout with socket timeout (not keepalive timeout)
@@ -997,9 +995,7 @@ def _sock_exact_recv(self, bufsize):
997995
rc += recv
998996
if time.monotonic() - stamp > read_timeout:
999997
raise MMQTTException(
1000-
"Unable to receive {} bytes within {} seconds.".format(
1001-
to_read, read_timeout
1002-
)
998+
f"Unable to receive {to_read} bytes within {read_timeout} seconds."
1003999
)
10041000
return rc
10051001

0 commit comments

Comments
 (0)