@@ -58,7 +58,9 @@ def _decode_header_lines(lines):
5858 # Python 3, validate() takes either and returns matches as bytes. But
5959 # on Python 2, validate can return matches as bytearrays, so we have
6060 # to explicitly cast back.
61- matches = validate (header_field_re , bytes (line ), "illegal header line: {!r}" , bytes (line ))
61+ matches = validate (
62+ header_field_re , bytes (line ), "illegal header line: {!r}" , bytes (line )
63+ )
6264 yield (matches ["field_name" ], matches ["field_value" ])
6365
6466
@@ -71,7 +73,9 @@ def maybe_read_from_IDLE_client(buf):
7173 return None
7274 if not lines :
7375 raise LocalProtocolError ("no request line received" )
74- matches = validate (request_line_re , lines [0 ], "illegal request line: {!r}" , lines [0 ])
76+ matches = validate (
77+ request_line_re , lines [0 ], "illegal request line: {!r}" , lines [0 ]
78+ )
7579 return Request (
7680 headers = list (_decode_header_lines (lines [1 :])), _parsed = True , ** matches
7781 )
@@ -152,7 +156,12 @@ def __call__(self, buf):
152156 chunk_header = buf .maybe_extract_until_next (b"\r \n " )
153157 if chunk_header is None :
154158 return None
155- matches = validate (chunk_header_re , chunk_header , "illegal chunk header: {!r}" , chunk_header )
159+ matches = validate (
160+ chunk_header_re ,
161+ chunk_header ,
162+ "illegal chunk header: {!r}" ,
163+ chunk_header ,
164+ )
156165 # XX FIXME: we discard chunk extensions. Does anyone care?
157166 # We convert to bytes because Python 2's `int()` function doesn't
158167 # work properly on bytearray objects.
0 commit comments