Skip to content

Commit

Permalink
Enable mypy for more libs
Browse files Browse the repository at this point in the history
  • Loading branch information
gpotter2 committed Nov 28, 2023
1 parent 438f22d commit 14176fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .config/mypy/mypy_enabled.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions scapy/arch/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 14176fd

Please sign in to comment.