From bd50b0d8b21bc1ce3e143da6d4fbcc9f2e3e9d22 Mon Sep 17 00:00:00 2001 From: anti Date: Fri, 1 May 2026 01:53:59 -0400 Subject: [PATCH] =?UTF-8?q?fix(types):=20T6=20=E2=80=94=20suppress=20scapy?= =?UTF-8?q?=20attr-defined=20on=20lazy=20imports=20in=20tcpfp.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- decnet/prober/tcpfp.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/decnet/prober/tcpfp.py b/decnet/prober/tcpfp.py index 3495230d..b0de7af7 100644 --- a/decnet/prober/tcpfp.py +++ b/decnet/prober/tcpfp.py @@ -48,7 +48,7 @@ def _send_syn( Craft a TCP SYN with common options and send it. Returns the SYN-ACK response packet or None on timeout/failure. """ - from scapy.all import IP, TCP, conf, sr1 + from scapy.all import IP, TCP, conf, sr1 # type: ignore[attr-defined] # Suppress scapy's noisy output conf.verb = 0 @@ -83,7 +83,7 @@ def _send_syn( return None # Verify it's a SYN-ACK (flags == 0x12) - from scapy.all import TCP as TCPLayer + from scapy.all import TCP as TCPLayer # type: ignore[attr-defined] if not resp.haslayer(TCPLayer): return None if resp[TCPLayer].flags != 0x12: # SYN-ACK @@ -103,7 +103,7 @@ def _send_rst( ) -> None: """Send RST to clean up the half-open connection.""" try: - from scapy.all import IP, TCP, send + from scapy.all import IP, TCP, send # type: ignore[attr-defined] rst = ( IP(dst=host) / TCP( @@ -124,7 +124,7 @@ def _parse_synack(resp: Any) -> dict[str, Any]: """ Extract fingerprint fields from a scapy SYN-ACK response packet. """ - from scapy.all import IP, TCP + from scapy.all import IP, TCP # type: ignore[attr-defined] ip_layer = resp[IP] tcp_layer = resp[TCP]