From 187e266b26d1513ce12c201821dcf1bf790efc39 Mon Sep 17 00:00:00 2001 From: BreakWa11 Date: Mon, 18 Jan 2016 18:07:14 +0800 Subject: [PATCH] refine "http_simple" in py3.4 --- shadowsocks/obfsplugin/http_simple.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shadowsocks/obfsplugin/http_simple.py b/shadowsocks/obfsplugin/http_simple.py index 2643c25..7b7fe88 100644 --- a/shadowsocks/obfsplugin/http_simple.py +++ b/shadowsocks/obfsplugin/http_simple.py @@ -78,7 +78,10 @@ class http_simple(plain.plain): def encode_head(self, buf): hexstr = binascii.hexlify(buf) - return b''.join([b"%" + pair for pair in [hexstr[i:i+2] for i in range(0, len(hexstr), 2)]]) + chs = [] + for i in range(0, len(hexstr), 2): + chs.append(b"%" + hexstr[i:i+2]) + return b''.join(chs) def client_encode(self, buf): if self.has_sent_header: