File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 2323import logging
2424import sys
2525from typing import Any , Dict , Union , cast
26+ from types import TracebackType
2627
2728log = logging .getLogger (__name__ .split ('.' , maxsplit = 1 )[0 ])
2829log .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
You can’t perform that action at this time.
0 commit comments