Created
September 28, 2016 02:25
-
-
Save mattrasband/72880537e48c28e90376e5b57c53d29c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
async def func_two(): | |
await asyncio.sleep(2.5) | |
raise RuntimeError | |
async def func_one(): | |
try: | |
await func_two() | |
except RuntimeError as e: | |
print('Error during async call!') | |
loop = asyncio.get_event_loop() | |
loop.run_until_complete(func_one()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment