import asyncio async def some_async_task(): await asyncio.sleep(4) return "result from some_async_task()" async def some_async_task2(): await asyncio.sleep(2) raise "Some exception" async def main(): result = await asyncio.gather(some_async_task(), some_async_task2(), return_exceptions=True) print(result) asyncio.run(main()) """Output: ['result from some_async_task()', TypeError('exceptions must derive from BaseException')] """