Skip to content

Commit 4db915b

Browse files
committed
mypy
1 parent 12f5cfd commit 4db915b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

zeroconf/_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,13 +319,13 @@ def _respond_query(
319319
@property
320320
def _socket_description(self) -> str:
321321
"""A human readable description of the socket."""
322+
assert self.transport is not None
322323
fileno = self.transport.get_extra_info('socket').fileno()
323324
sockname = self.transport.get_extra_info('sockname')
324325
return f"{fileno} ({sockname})"
325326

326327
def error_received(self, exc: Exception) -> None:
327328
"""Likely socket closed or IPv6."""
328-
assert self.transport is not None
329329
# We preformat the message string with the socket as we want
330330
# log_exception_once to log a warrning message once PER EACH
331331
# different socket in case there are problems with multiple

zeroconf/_logger.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import logging
2424
import sys
2525
from typing import Any, Dict, Union, cast
26+
from types import TracebackType
2627

2728
log = logging.getLogger(__name__.split('.', maxsplit=1)[0])
2829
log.addHandler(logging.NullHandler())
@@ -63,7 +64,7 @@ def log_warning_once(cls, *args: Any) -> None:
6364
logger(*args)
6465

6566
@classmethod
66-
def log_exception_once(cls, exc_info, *args: Any) -> None:
67+
def log_exception_once(cls, exc_info: TracebackType, *args: Any) -> None:
6768
msg_str = args[0]
6869
if msg_str not in cls._seen_logs:
6970
cls._seen_logs[msg_str] = 0

0 commit comments

Comments
 (0)