Guest User

Untitled

a guest
May 14th, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1.         try:
  2.             _r, w = await asyncio.wait_for(asyncio.open_connection(task.ip, task.port),
  3.                                            task.timeout)
  4.         except (asyncio.TimeoutError, ConnectionRefusedError):
  5.             pass
  6.         else:
  7.             w.close()
  8.             yield task  # yield successful tasks
Add Comment
Please, Sign In to add comment