From 14176fd4de4e0622709deec378447834384734ed Mon Sep 17 00:00:00 2001 From: gpotter2 <10530980+gpotter2@users.noreply.github.com> Date: Tue, 28 Nov 2023 21:39:45 +0100 Subject: [PATCH] Enable mypy for more libs --- .config/mypy/mypy_enabled.txt | 5 +++++ scapy/arch/linux.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.config/mypy/mypy_enabled.txt b/.config/mypy/mypy_enabled.txt index 1856a0e57dc..076316559bc 100644 --- a/.config/mypy/mypy_enabled.txt +++ b/.config/mypy/mypy_enabled.txt @@ -91,7 +91,12 @@ scapy/contrib/roce.py scapy/contrib/tcpao.py # LIBS +scapy/libs/__init__.py +scapy/libs/ethertypes.py scapy/libs/extcap.py +scapy/libs/matplot.py +scapy/libs/structures.py +scapy/libs/test_pyx.py # TEST test/testsocket.py diff --git a/scapy/arch/linux.py b/scapy/arch/linux.py index 0d1c4040f6e..b79cda1315e 100644 --- a/scapy/arch/linux.py +++ b/scapy/arch/linux.py @@ -160,12 +160,12 @@ def attach_filter(sock, bpf_filter, iface): if conf.use_pypy and sys.pypy_version_info <= (7, 3, 2): # type: ignore # PyPy < 7.3.2 has a broken behavior # https://foss.heptapod.net/pypy/pypy/-/issues/3298 - bp = struct.pack( + bp = struct.pack( # type: ignore 'HL', bp.bf_len, ctypes.addressof(bp.bf_insns.contents) ) else: - bp = sock_fprog(bp.bf_len, bp.bf_insns) + bp = sock_fprog(bp.bf_len, bp.bf_insns) # type: ignore sock.setsockopt(socket.SOL_SOCKET, SO_ATTACH_FILTER, bp)