Advertisement
cooperlees

Untitled

Oct 6th, 2019
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. class StatsDProtocol(asyncio.DatagramProtocol):
  2.      def __init__(self, data: bytes) -> None:
  3.          self.data = data
  4.  
  5. -    def connection_made(
  6. -        self, transport: asyncio.selector_events.BaseSelectorEventLoop
  7. -    ) -> None:
  8. -        transport.sendto(self.data)
  9. +    def connection_made(self, transport: asyncio.transports.BaseTransport) -> None:
  10. +        # supertype defines the argument type as "BaseTransport"
  11. +        # BaseTransport has no sendto()
  12. +        transport.sendto(self.data)  # type: ignore
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement