From f62a550e9f8351ab3dc9d57e0fb554d5022b3d81 Mon Sep 17 00:00:00 2001 From: mengskysama Date: Sat, 16 Apr 2016 12:13:59 +0800 Subject: [PATCH] pep8 --- shadowsocks/tcprelay.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shadowsocks/tcprelay.py b/shadowsocks/tcprelay.py index cf45351..5100f1c 100644 --- a/shadowsocks/tcprelay.py +++ b/shadowsocks/tcprelay.py @@ -100,9 +100,11 @@ BUF_SIZE = 32 * 1024 class BadSocksHeader(Exception): pass + class NoAcceptableMethods(Exception): pass + class TCPRelayHandler(object): def __init__(self, server, fd_to_handlers, loop, local_sock, config, dns_resolver, is_local): @@ -500,7 +502,8 @@ class TCPRelayHandler(object): socks_version = common.ord(data[0]) nmethods = common.ord(data[1]) if socks_version != 5: - logging.warning('unsupported SOCKS protocol version ' + str(socks_version)) + logging.warning('unsupported SOCKS protocol version ' + + str(socks_version)) raise BadSocksHeader if nmethods < 1 or len(data) != nmethods + 2: logging.warning('NMETHODS and number of METHODS mismatch') @@ -511,7 +514,8 @@ class TCPRelayHandler(object): noauth_exist = True break if not noauth_exist: - logging.warning('none of METHOD\'s requested by client is supported') + logging.warning('none of SOCKS METHOD\'s ' + 'requested by client is supported') raise NoAcceptableMethods def _handle_stage_init(self, data):