summaryrefslogtreecommitdiffstats
path: root/glucometerutils/support/contourusb.py
diff options
context:
space:
mode:
Diffstat (limited to 'glucometerutils/support/contourusb.py')
-rw-r--r--glucometerutils/support/contourusb.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/glucometerutils/support/contourusb.py b/glucometerutils/support/contourusb.py
index 3b0dc80..9afb79d 100644
--- a/glucometerutils/support/contourusb.py
+++ b/glucometerutils/support/contourusb.py
@@ -180,14 +180,14 @@ class ContourHidDevice(hiddevice.HidDevice):
if recno != self.currecno:
raise FrameError(
- "Bad recno, got %r expected %r" % (recno, self.currecno), frame
+ f"Bad recno, got {recno!r} expected {self.currecno!r}", frame
)
- checksum = self.checksum(match.group("check"))
- if checksum != match.group("checksum"):
+ calculated_checksum = self.checksum(match.group("check"))
+ received_checksum = match.group("checksum")
+ if calculated_checksum != received_checksum:
raise FrameError(
- "Checksum error: got %s expected %s"
- % (match.group("checksum"), checksum),
+ f"Checksum error: received {received_checksum} expected {calculated_checksum}",
frame,
)