From 5bf07b217678852bb0075d1aa6137b32606fcd08 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 21 Nov 2020 17:18:52 +0100 Subject: [PATCH] [sans-io] clientplayback: don't catch cancellederror --- mitmproxy/addons/clientplayback_sansio.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/mitmproxy/addons/clientplayback_sansio.py b/mitmproxy/addons/clientplayback_sansio.py index a194bc6d7..0df7610fd 100644 --- a/mitmproxy/addons/clientplayback_sansio.py +++ b/mitmproxy/addons/clientplayback_sansio.py @@ -106,17 +106,14 @@ class ClientPlayback: self.playback_task.cancel() async def playback(self): - try: - while True: - self.inflight = await self.queue.get() - try: - h = ReplayHandler(self.inflight, self.options) - await h.replay() - except Exception: - ctx.log(f"Client replay has crashed!\n{traceback.format_exc()}", "error") - self.inflight = None - except asyncio.CancelledError: - return + while True: + self.inflight = await self.queue.get() + try: + h = ReplayHandler(self.inflight, self.options) + await h.replay() + except Exception: + ctx.log(f"Client replay has crashed!\n{traceback.format_exc()}", "error") + self.inflight = None def check(self, f: flow.Flow) -> typing.Optional[str]: if f.live: