]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Drop unreachable except block (#69)
authorTom Christie <tom@tomchristie.com>
Thu, 16 May 2019 09:48:19 +0000 (10:48 +0100)
committerGitHub <noreply@github.com>
Thu, 16 May 2019 09:48:19 +0000 (10:48 +0100)
httpcore/dispatch/http11.py

index 39f72db42afa9c82208d2fc9507e9469768123d3..fc5f34fca8ba444e9d6b788ad519d90e5203fbe9 100644 (file)
@@ -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]: