[arch-commits] Commit in shadowsocks/repos/community-any (pycodestyle.patch)
Eli Schwartz
eschwartz at archlinux.org
Wed Dec 5 15:21:58 UTC 2018
Date: Wednesday, December 5, 2018 @ 15:21:57
Author: eschwartz
Revision: 411526
copy missing patch to repos/ as well
Added:
shadowsocks/repos/community-any/pycodestyle.patch
(from rev 411525, shadowsocks/trunk/pycodestyle.patch)
-------------------+
pycodestyle.patch | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
Copied: shadowsocks/repos/community-any/pycodestyle.patch (from rev 411525, shadowsocks/trunk/pycodestyle.patch)
===================================================================
--- pycodestyle.patch (rev 0)
+++ pycodestyle.patch 2018-12-05 15:21:57 UTC (rev 411526)
@@ -0,0 +1,62 @@
+commit 0225b05029493d477bde6391f3b0108519783a2e
+Author: Felix Yan <felixonmars at archlinux.org>
+Date: Tue Nov 13 02:50:07 2018 +0800
+
+ Use pycodestyle instead of pep8
+
+diff --git a/.travis.yml b/.travis.yml
+index f11e179..cb02428 100644
+--- a/.travis.yml
++++ b/.travis.yml
+@@ -13,7 +13,7 @@ before_install:
+ - sudo dd if=/dev/urandom of=/usr/share/nginx/html/file bs=1M count=10
+ - sudo sh -c "echo '127.0.0.1 localhost' > /etc/hosts"
+ - sudo service nginx restart
+- - pip install pep8 pyflakes nose coverage PySocks
++ - pip install pycodestyle pyflakes nose coverage PySocks
+ - sudo tests/socksify/install.sh
+ - sudo tests/libsodium/install.sh
+ - sudo tests/libmbedtls/install.sh
+diff --git a/shadowsocks/common.py b/shadowsocks/common.py
+index 1a58457..840608f 100644
+--- a/shadowsocks/common.py
++++ b/shadowsocks/common.py
+@@ -185,8 +185,8 @@ def parse_header(data):
+ addrlen = ord(data[1])
+ if len(data) >= 4 + addrlen:
+ dest_addr = data[2:2 + addrlen]
+- dest_port = struct.unpack('>H', data[2 + addrlen:4 +
+- addrlen])[0]
++ dest_port = struct.unpack('>H', data[2 + addrlen:
++ 4 + addrlen])[0]
+ header_length = 4 + addrlen
+ else:
+ logging.warn('header is too short')
+diff --git a/shadowsocks/tcprelay.py b/shadowsocks/tcprelay.py
+index 0ef913f..423cc80 100644
+--- a/shadowsocks/tcprelay.py
++++ b/shadowsocks/tcprelay.py
+@@ -519,8 +519,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 {}'
++ .format(socks_version))
+ raise BadSocksHeader
+ if nmethods < 1 or len(data) != nmethods + 2:
+ logging.warning('NMETHODS and number of METHODS mismatch')
+diff --git a/tests/jenkins.sh b/tests/jenkins.sh
+index 85dd01a..4288336 100755
+--- a/tests/jenkins.sh
++++ b/tests/jenkins.sh
+@@ -27,7 +27,7 @@ function run_test {
+ python --version
+ coverage erase
+ mkdir tmp
+-run_test pep8 --ignore=E402 .
++run_test pycodestyle --ignore=E402,E305,E741 .
+ run_test pyflakes .
+ run_test coverage run tests/nose_plugin.py -v
+ run_test python setup.py sdist
More information about the arch-commits
mailing list