Thread (15 messages) flat view 15 messages, 5 authors, 2018-12-25
STALE2809d

[PATCH 3/7] selftest/bpf: PEP 8: multiple statements on one line (colon)

From: Alice Ferrazzi <hidden>
Date: 2018-12-11 11:55:49
Also in: lkml
Subsystem: bpf [general] (safe dynamic programs and tools), bpf [selftests] (test runners & infrastructure), kernel selftest framework, the rest · Maintainers: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Eduard Zingerman, Kumar Kartikeya Dwivedi, Shuah Khan, Shuah Khan, Linus Torvalds

Reformat the file for fixing PEP 8 style

Signed-off-by: Alice Ferrazzi <redacted>
---
 tools/testing/selftests/bpf/tcp_client.py | 13 +++++++++----
 tools/testing/selftests/bpf/tcp_server.py | 16 +++++++++++-----
 2 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/tools/testing/selftests/bpf/tcp_client.py b/tools/testing/selftests/bpf/tcp_client.py
index ad3de27cd605..31f022bf06fa 100755
--- a/tools/testing/selftests/bpf/tcp_client.py
+++ b/tools/testing/selftests/bpf/tcp_client.py
@@ -11,17 +11,22 @@ def read(sock, n):
     buf = b''
     while len(buf) < n:
         rem = n - len(buf)
-        try: s = sock.recv(rem)
-        except (socket.error) as e: return b''
+        try:
+            s = sock.recv(rem)
+        except (socket.error) as e:
+            return b''
         buf += s
     return buf
 
+
 def send(sock, s):
     total = len(s)
     count = 0
     while count < total:
-        try: n = sock.send(s)
-        except (socket.error) as e: n = 0
+        try:
+            n = sock.send(s)
+        except (socket.error) as e:
+            n = 0
         if n == 0:
             return count
         count += n
diff --git a/tools/testing/selftests/bpf/tcp_server.py b/tools/testing/selftests/bpf/tcp_server.py
index f7491517cc49..af79210249af 100755
--- a/tools/testing/selftests/bpf/tcp_server.py
+++ b/tools/testing/selftests/bpf/tcp_server.py
@@ -13,17 +13,22 @@ def read(sock, n):
     buf = b''
     while len(buf) < n:
         rem = n - len(buf)
-        try: s = sock.recv(rem)
-        except (socket.error) as e: return b''
+        try:
+            s = sock.recv(rem)
+        except (socket.error) as e:
+            return b''
         buf += s
     return buf
 
+
 def send(sock, s):
     total = len(s)
     count = 0
     while count < total:
-        try: n = sock.send(s)
-        except (socket.error) as e: n = 0
+        try:
+            n = sock.send(s)
+        except (socket.error) as e:
+            n = 0
         if n == 0:
             return count
         count += n
@@ -42,7 +47,8 @@ HostName = socket.gethostname()
 serverSocket = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
 host = socket.gethostname()
 
-try: serverSocket.bind((host, 0))
+try:
+    serverSocket.bind((host, 0))
 except socket.error as msg:
     print('bind fails: ' + str(msg))
 
-- 
2.19.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help