From 0969937fd1b99ef72b6e959b13834aeb9d486a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=B4=E5=A8=83=E9=85=B1?= Date: Thu, 4 May 2017 14:31:24 +0800 Subject: [PATCH] fix bytes type --- shadowsocks/asyncdns.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shadowsocks/asyncdns.py b/shadowsocks/asyncdns.py index 01f2522..9713ec1 100644 --- a/shadowsocks/asyncdns.py +++ b/shadowsocks/asyncdns.py @@ -331,8 +331,8 @@ class DNSResolver(object): with open(etc_path, 'rb') as f: for line in f.readlines(): line = line.strip() - if "#" in line: - line = line[:line.find('#')] + if b"#" in line: + line = line[:line.find(b'#')] parts = line.split() if len(parts) >= 2: ip = parts[0]