From 388285675b491908cb9ea3866b68f5b0e86f269b Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 3 Aug 2015 16:49:09 +0900 Subject: [PATCH] python: Check protocol is None --- python/nghttp2.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/nghttp2.pyx b/python/nghttp2.pyx index 3eaf147b..928f099f 100644 --- a/python/nghttp2.pyx +++ b/python/nghttp2.pyx @@ -1268,7 +1268,7 @@ if asyncio: if ssl_ctx: protocol = sock.selected_npn_protocol() logging.info('npn, protocol:%s', protocol) - if protocol.encode('utf-8') != \ + if protocol is None or protocol.encode('utf-8') != \ cnghttp2.NGHTTP2_PROTO_VERSION_ID: self.transport.abort() return