mirror of https://github.com/scrapy/scrapy.git
HTTP/2 stream close reason handling: Use else + assert instead of elif
This commit is contained in:
parent
bd29f32dee
commit
5ba31cd1a2
|
|
@ -431,7 +431,8 @@ class Stream:
|
|||
errors.insert(0, InactiveStreamClosed(self._request))
|
||||
self._deferred_response.errback(ResponseFailed(errors))
|
||||
|
||||
elif reason is StreamCloseReason.INVALID_HOSTNAME:
|
||||
else:
|
||||
assert reason is StreamCloseReason.INVALID_HOSTNAME
|
||||
self._deferred_response.errback(InvalidHostname(
|
||||
self._request,
|
||||
str(self._protocol.metadata['uri'].host, 'utf-8'),
|
||||
|
|
|
|||
Loading…
Reference in New Issue