From c3b40a6f0a3778572d6d35ee7dd447132875db42 Mon Sep 17 00:00:00 2001 From: Richard Neumann Date: Sun, 14 Aug 2022 23:29:42 +0200 Subject: [PATCH] Suppress possible timeout errors on following packet readouts --- rcon/source/proto.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rcon/source/proto.py b/rcon/source/proto.py index 4c00af9..f14567e 100644 --- a/rcon/source/proto.py +++ b/rcon/source/proto.py @@ -2,6 +2,7 @@ from __future__ import annotations from asyncio import StreamReader +from contextlib import suppress from enum import Enum from functools import partial from logging import getLogger @@ -116,7 +117,8 @@ class Packet(NamedTuple): # Attempt to read following packets on large responses. if size >= max_pkg_size: - payload += cls.read(file, max_pkg_size=max_pkg_size).payload + with suppress(TimeoutError): + payload += cls.read(file, max_pkg_size=max_pkg_size).payload return cls(id_, type_, payload, terminator)