From 8fe51bcb2d208654aefba38004aaa105a6e8339a Mon Sep 17 00:00:00 2001 From: Arkadiusz Bulski Date: Wed, 7 Mar 2018 02:09:20 +0100 Subject: Update sdcodefree.py lambdafied this expression --- glucometerutils/drivers/sdcodefree.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glucometerutils/drivers/sdcodefree.py b/glucometerutils/drivers/sdcodefree.py index 5bc76fb..ac3e228 100644 --- a/glucometerutils/drivers/sdcodefree.py +++ b/glucometerutils/drivers/sdcodefree.py @@ -45,8 +45,8 @@ _PACKET = construct.Struct( construct.Byte, {e: e.value for e in Direction}), 'length' / construct.Rebuild( - construct.Byte, lambda ctx: len(ctx.message) + 2), - 'message' / construct.Bytes(length=lambda ctx: ctx.length - 2), + construct.Byte, lambda this: len(this.message) + 2), + 'message' / construct.Bytes(lambda this: len(this.message)), 'checksum' / construct.Checksum( construct.Byte, xor_checksum, construct.this.message), 'etx' / construct.Const(0xAA, construct.Byte) -- cgit v1.2.3