summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Żenczykowski <maze@google.com>2021-02-15 21:04:52 -0800
committerMaciej Żenczykowski <maze@google.com>2021-02-15 21:07:17 -0800
commit6f3199af05779f5373afcc55e2724ad697095c6d (patch)
treecca98857a0dee6694371e16d0e9254e7a5eb5146
parentde4c8b6a7b62b9e554da08cb18c74765084184c5 (diff)
downloadtests-6f3199af05779f5373afcc55e2724ad697095c6d.tar.gz
net-test: bpf_test - use proper except typeandroid-s-preview-1
As Lorenzo helpfully pointed out: You can just make this be "except socket.error" and get rid of the pylint comment. ... No need to guess, just look at the implementation of LookupMap. It bottoms out at BpfSyscall, which calls MaybeRaiseSocketError, which raises socket.error. Test: gpylint2 bpf.py bpf_test.py Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Ic6cc0eb794349f09143e23fa14a240b89b9e3010
-rwxr-xr-xnet/test/bpf_test.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/test/bpf_test.py b/net/test/bpf_test.py
index 4a1790d..92bbe50 100755
--- a/net/test/bpf_test.py
+++ b/net/test/bpf_test.py
@@ -119,7 +119,7 @@ def PrintMapInfo(map_fd):
value = LookupMap(map_fd, next_key)
print(repr(next_key) + " : " + repr(value.value)) # pylint: disable=superfluous-parens
key = next_key
- except Exception: # pylint: disable=broad-except
+ except socket.error:
print("no value") # pylint: disable=superfluous-parens
break