From 8c43fca3436aa07fb5c90d35c34626b4c87925ff Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 16 May 2019 10:48:19 +0100 Subject: [PATCH] Drop unreachable except block (#69) --- httpcore/dispatch/http11.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/httpcore/dispatch/http11.py b/httpcore/dispatch/http11.py index 39f72db4..fc5f34fc 100644 --- a/httpcore/dispatch/http11.py +++ b/httpcore/dispatch/http11.py @@ -94,14 +94,7 @@ class HTTP11Connection: async def close(self) -> None: event = h11.ConnectionClosed() - try: - # If we're in h11.MUST_CLOSE then we'll end up in h11.CLOSED. - self.h11_state.send(event) - except h11.ProtocolError: - # If we're in some other state then it's a premature close, - # and we'll end up in h11.ERROR. - pass - + self.h11_state.send(event) await self.writer.close() async def _body_iter(self, timeout: OptionalTimeout) -> typing.AsyncIterator[bytes]: