mirror of https://github.com/scrapy/scrapy.git
fix: InvalidNegotiatedProtocol __str__ method
This commit is contained in:
parent
e3233b79de
commit
30eb005639
|
|
@ -68,7 +68,7 @@ class H2ConnectionPool:
|
|||
|
||||
# Now as we have established a proper HTTP/2 connection
|
||||
# we fire all the deferred's with the connection instance
|
||||
pending_requests = self._pending_requests.pop(key)
|
||||
pending_requests = self._pending_requests.pop(key, None)
|
||||
while pending_requests:
|
||||
d = pending_requests.popleft()
|
||||
d.callback(conn)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class InvalidNegotiatedProtocol(H2Error):
|
|||
self.negotiated_protocol = negotiated_protocol
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f'InvalidHostname: Expected h2 as negotiated protocol, received {self.negotiated_protocol!r}'
|
||||
return f'InvalidNegotiatedProtocol: Expected h2 as negotiated protocol, received {self.negotiated_protocol!r}'
|
||||
|
||||
|
||||
class RemoteTerminatedConnection(H2Error):
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@ class InactiveStreamClosed(ConnectionClosed):
|
|||
def __init__(self, request: Request):
|
||||
self.request = request
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f'InactiveStreamClosed: Connection was closed without sending the request {self.request!r}'
|
||||
|
||||
|
||||
class InvalidHostname(H2Error):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue