Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async def run_client(host, command):
- try:
- with (yield from asyncio.wait_for(asyncssh.connect('localhost'), timeout = 3)) as conn:
- return await conn.run(command)
- except TimeoutError:
- # handle connection timeout
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement