提交 5ba31cd1 编写于 作者: A Adrián Chaves

HTTP/2 stream close reason handling: Use else + assert instead of elif

上级 bd29f32d
......@@ -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'),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册