fix(types): T1 — remove 15 stale type: ignore comments confirmed unused by mypy
This commit is contained in:
@@ -169,10 +169,10 @@ class CanaryDNSProtocol(asyncio.DatagramProtocol):
|
||||
self._answer_ip = answer_ip
|
||||
self._transport: Optional[asyncio.DatagramTransport] = None
|
||||
|
||||
def connection_made(self, transport) -> None: # type: ignore[override]
|
||||
self._transport = transport # type: ignore[assignment]
|
||||
def connection_made(self, transport) -> None:
|
||||
self._transport = transport
|
||||
|
||||
def datagram_received( # type: ignore[override]
|
||||
def datagram_received(
|
||||
self, data: bytes, addr: Tuple[str, int],
|
||||
) -> None:
|
||||
try:
|
||||
|
||||
@@ -43,7 +43,7 @@ class HoneydocPdfGenerator(CanaryGenerator):
|
||||
|
||||
def generate(self, ctx: CanaryContext) -> CanaryArtifact:
|
||||
try:
|
||||
from pikepdf import Pdf, Name, Dictionary, String # type: ignore[import-not-found]
|
||||
from pikepdf import Pdf, Name, Dictionary, String
|
||||
except ImportError as e:
|
||||
raise InstrumenterRejectedError(
|
||||
"honeydoc_pdf requires pikepdf; install it (`pip install "
|
||||
|
||||
@@ -32,7 +32,7 @@ class ImageInstrumenter(CanaryInstrumenter):
|
||||
self, blob: bytes, ctx: CanaryContext, *, target_path: str,
|
||||
) -> CanaryArtifact:
|
||||
try:
|
||||
from PIL import Image, PngImagePlugin # type: ignore[import-not-found]
|
||||
from PIL import Image, PngImagePlugin
|
||||
except ImportError as e:
|
||||
raise InstrumenterRejectedError(
|
||||
"image instrumenter requires Pillow; install it (`pip "
|
||||
|
||||
@@ -34,7 +34,7 @@ class PdfInstrumenter(CanaryInstrumenter):
|
||||
self, blob: bytes, ctx: CanaryContext, *, target_path: str,
|
||||
) -> CanaryArtifact:
|
||||
try:
|
||||
import pikepdf # type: ignore[import-not-found]
|
||||
import pikepdf
|
||||
except ImportError as e:
|
||||
raise InstrumenterRejectedError(
|
||||
"PDF instrumenter requires pikepdf; install it (`pip "
|
||||
|
||||
@@ -380,7 +380,7 @@ async def _start_dns_server(
|
||||
local_addr=(_dns_bind(), _dns_port()),
|
||||
)
|
||||
log.info("canary.dns listening zone=%s port=%d", zone, _dns_port())
|
||||
return transport # type: ignore[return-value]
|
||||
return transport
|
||||
|
||||
|
||||
# ---------------------------- entry point --------------------------------
|
||||
|
||||
Reference in New Issue
Block a user