diff --git a/examples/trio-server.py b/examples/trio-server.py index 214ab51..653cf52 100644 --- a/examples/trio-server.py +++ b/examples/trio-server.py @@ -83,13 +83,16 @@ import h11 + MAX_RECV = 2 ** 16 TIMEOUT = 10 + ################################################################ # I/O adapter: h11 <-> trio ################################################################ + # The core of this could be factored out to be usable for trio-based clients # too, as well as servers. But as a simplified pedagogical example we don't # attempt this here. diff --git a/h11/_connection.py b/h11/_connection.py index 410c4e9..bdc4880 100644 --- a/h11/_connection.py +++ b/h11/_connection.py @@ -32,6 +32,7 @@ # - Apache: <8 KiB per line> DEFAULT_MAX_INCOMPLETE_EVENT_SIZE = 16 * 1024 + # RFC 7230's rules for connection lifecycles: # - If either side says they want to close the connection, then the connection # must close. @@ -501,7 +502,7 @@ def send_with_data_passthrough(self, event): data_list = [] writer(event, data_list.append) return data_list - except: + except BaseException: self._process_error(self.our_role) raise diff --git a/h11/tests/test_events.py b/h11/tests/test_events.py index 07ffc13..575abd0 100644 --- a/h11/tests/test_events.py +++ b/h11/tests/test_events.py @@ -161,7 +161,7 @@ def test_intenum_status_code(): r = Response(status_code=HTTPStatus.OK, headers=[], http_version="1.0") assert r.status_code == HTTPStatus.OK - assert type(r.status_code) is not type(HTTPStatus.OK) + assert type(r.status_code) is not type(HTTPStatus.OK) # noqa: F721 assert type(r.status_code) is int diff --git a/setup.cfg b/setup.cfg index bda6834..6c0725d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,3 +11,13 @@ line_length=88 multi_line_output=3 no_lines_before=LOCALFOLDER order_by_type=False + +[flake8] +max-line-length = 88 +extend-ignore = + # 'from .foo import *' used; unable to detect undefined names + F403 + # 'Foo' may be undefined, or defined from star import: foo + F405 + # whitespace before ':' + E203