From 2a5ee41b516e708eebdb18385d2fa50a6520504e Mon Sep 17 00:00:00 2001 From: Richard Neumann Date: Mon, 11 Jan 2021 23:23:14 +0100 Subject: [PATCH] Fixed terminator check on Packet.aread(). --- rcon/proto.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rcon/proto.py b/rcon/proto.py index c08ff48..ba49a55 100644 --- a/rcon/proto.py +++ b/rcon/proto.py @@ -110,10 +110,10 @@ class Packet(NamedTuple): payload = await file.read(size - 10) terminator = await file.read(2) - if terminator != TERMINATOR: + if (terminator := terminator.decode()) != TERMINATOR: LOGGER.warning('Unexpected terminator: %s', terminator) - return cls(id_, type_, payload.decode(), terminator.decode()) + return cls(id_, type_, payload.decode(), terminator) @classmethod def read(cls, file: IO) -> Packet: