|
|
@ -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: |
|
|
|