From 92d5067f6ff7e557be0f45f0bcee6f1358736b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Valur=20J=C3=B3nsson?= Date: Sun, 17 Sep 2023 10:18:26 +0000 Subject: [PATCH] use list.clear() --- tests/resp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/resp.py b/tests/resp.py index abf4b69b05..c0b8895527 100644 --- a/tests/resp.py +++ b/tests/resp.py @@ -361,7 +361,7 @@ def parse(self, buffer: bytes) -> Optional[Any]: # create a new parser generator, initializing it with # any unparsed data from previous calls buffer = b"".join(self.consumed) + buffer - del self.consumed[:] + self.consumed.clear() self.generator = self.parser.parse(buffer) parsed = self.generator.send(None) else: @@ -386,7 +386,7 @@ def close(self) -> None: if self.generator is not None: self.generator.close() self.generator = None - del self.consumed[:] + self.consumed.clear() def parse_all(buffer: bytes) -> Tuple[List[Any], bytes]: